2012-06-16 11:50:14 +02:00
|
|
|
Then /^I should see "(.*?)" link$/ do |arg1|
|
|
|
|
page.should have_link(arg1)
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see "(.*?)" project link$/ do |arg1|
|
|
|
|
page.should have_link(arg1)
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see project "(.*?)" activity feed$/ do |arg1|
|
|
|
|
project = Project.find_by_name(arg1)
|
|
|
|
page.should have_content "#{@user.name} pushed new branch new_design at #{project.name}"
|
|
|
|
end
|
|
|
|
|
|
|
|
Given /^project "(.*?)" has push event$/ do |arg1|
|
|
|
|
@project = Project.find_by_name(arg1)
|
|
|
|
|
|
|
|
data = {
|
|
|
|
:before => "0000000000000000000000000000000000000000",
|
|
|
|
:after => "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e",
|
|
|
|
:ref => "refs/heads/new_design",
|
|
|
|
:user_id => @user.id,
|
|
|
|
:user_name => @user.name,
|
|
|
|
:repository => {
|
|
|
|
:name => @project.name,
|
|
|
|
:url => "localhost/rubinius",
|
|
|
|
:description => "",
|
|
|
|
:homepage => "localhost/rubinius",
|
|
|
|
:private => true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@event = Event.create(
|
|
|
|
:project => @project,
|
|
|
|
:action => Event::Pushed,
|
|
|
|
:data => data,
|
|
|
|
:author_id => @user.id
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see last push widget$/ do
|
2012-06-21 17:41:22 +02:00
|
|
|
page.should have_content "Your pushed to branch new_design"
|
2012-06-16 11:50:14 +02:00
|
|
|
page.should have_link "Create Merge Request"
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I click "(.*?)" link$/ do |arg1|
|
2012-06-18 18:34:09 +02:00
|
|
|
click_link arg1 #Create Merge Request"
|
2012-06-16 11:50:14 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I see prefilled new Merge Request page$/ do
|
2012-09-06 08:15:51 +02:00
|
|
|
current_path.should == new_project_merge_request_path(@project)
|
|
|
|
find("#merge_request_source_branch").value.should == "new_design"
|
|
|
|
find("#merge_request_target_branch").value.should == "master"
|
|
|
|
find("#merge_request_title").value.should == "New Design"
|
2012-06-16 11:50:14 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Given /^I visit dashboard search page$/ do
|
|
|
|
visit search_path
|
|
|
|
end
|
|
|
|
|
|
|
|
Given /^I search for "(.*?)"$/ do |arg1|
|
|
|
|
fill_in "dashboard_search", :with => arg1
|
|
|
|
click_button "Search"
|
|
|
|
end
|
2012-07-29 19:22:48 +02:00
|
|
|
|
|
|
|
Then /^I should see issues assigned to me$/ do
|
|
|
|
issues = @user.issues
|
|
|
|
issues.each do |issue|
|
|
|
|
page.should have_content(issue.title[0..10])
|
|
|
|
page.should have_content(issue.project.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see my merge requests$/ do
|
|
|
|
merge_requests = @user.merge_requests
|
|
|
|
merge_requests.each do |mr|
|
|
|
|
page.should have_content(mr.title[0..10])
|
|
|
|
page.should have_content(mr.project.name)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Given /^I have assigned issues$/ do
|
2012-08-24 10:48:30 +02:00
|
|
|
project = Factory :project
|
|
|
|
project.add_access(@user, :read, :write)
|
2012-07-29 19:22:48 +02:00
|
|
|
|
|
|
|
issue1 = Factory :issue,
|
|
|
|
:author => @user,
|
|
|
|
:assignee => @user,
|
2012-08-24 10:48:30 +02:00
|
|
|
:project => project
|
2012-07-29 19:22:48 +02:00
|
|
|
|
|
|
|
issue2 = Factory :issue,
|
|
|
|
:author => @user,
|
|
|
|
:assignee => @user,
|
2012-08-24 10:48:30 +02:00
|
|
|
:project => project
|
2012-07-29 19:22:48 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Given /^I have authored merge requests$/ do
|
2012-08-29 03:13:22 +02:00
|
|
|
project1 = Factory :project
|
2012-07-29 19:22:48 +02:00
|
|
|
|
2012-08-29 03:13:22 +02:00
|
|
|
project2 = Factory :project
|
2012-07-29 19:22:48 +02:00
|
|
|
|
|
|
|
project1.add_access(@user, :read, :write)
|
|
|
|
project2.add_access(@user, :read, :write)
|
|
|
|
|
|
|
|
merge_request1 = Factory :merge_request,
|
|
|
|
:author => @user,
|
|
|
|
:project => project1
|
|
|
|
|
|
|
|
merge_request2 = Factory :merge_request,
|
|
|
|
:author => @user,
|
|
|
|
:project => project2
|
|
|
|
end
|
2012-09-09 22:18:28 +02:00
|
|
|
|
|
|
|
Given /^user with name "(.*?)" joined project "(.*?)"$/ do |user_name, project_name|
|
|
|
|
user = Factory.create(:user, {name: user_name})
|
|
|
|
project = Project.find_by_name project_name
|
|
|
|
Event.create(
|
|
|
|
project: project,
|
|
|
|
author_id: user.id,
|
|
|
|
action: Event::Joined
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2012-09-09 23:27:47 +02:00
|
|
|
Given /^user with name "(.*?)" left project "(.*?)"$/ do |user_name, project_name|
|
|
|
|
user = User.find_by_name user_name
|
|
|
|
project = Project.find_by_name project_name
|
|
|
|
Event.create(
|
|
|
|
project: project,
|
|
|
|
author_id: user.id,
|
|
|
|
action: Event::Left
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2012-09-09 22:18:28 +02:00
|
|
|
Then /^I should see "(.*?)" event$/ do |event_text|
|
|
|
|
page.should have_content(event_text)
|
|
|
|
end
|
|
|
|
|