summaryrefslogtreecommitdiff
path: root/features/steps/project/merge_requests.rb
diff options
context:
space:
mode:
Diffstat (limited to 'features/steps/project/merge_requests.rb')
-rw-r--r--features/steps/project/merge_requests.rb62
1 files changed, 41 insertions, 21 deletions
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index c009568977d..6e2f60972b6 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -1,5 +1,6 @@
class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
include SharedAuthentication
+ include SharedIssuable
include SharedProject
include SharedNote
include SharedPaths
@@ -55,10 +56,21 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
page.should_not have_content "Bug NS-04"
end
+ step 'I should see that I am subscribed' do
+ find(".subscribe-button span").text.should == "Unsubscribe"
+ end
+
+ step 'I should see that I am unsubscribed' do
+ sleep 0.2
+ find(".subscribe-button span").text.should == "Subscribe"
+ end
+
+ step 'I click button "Unsubscribe"' do
+ click_on "Unsubscribe"
+ end
+
step 'I click link "Close"' do
- within '.page-title' do
- click_link "Close"
- end
+ first(:css, '.close-mr-link').click
end
step 'I submit new merge request "Wiki Feature"' do
@@ -102,16 +114,20 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I switch to the diff tab' do
- visit diffs_project_merge_request_path(project, merge_request)
+ visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request)
end
step 'I switch to the merge request\'s comments tab' do
- visit project_merge_request_path(project, merge_request)
+ visit namespace_project_merge_request_path(project.namespace, project, merge_request)
end
step 'I click on the commit in the merge request' do
- within '.mr-commits' do
- click_link sample_commit.id[0..8]
+ within '.merge-request-tabs' do
+ click_link 'Commits'
+ end
+
+ within '.commits' do
+ click_link Commit.truncate_sha(sample_commit.id)
end
end
@@ -153,7 +169,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'merge request is mergeable' do
- page.should have_content 'You can accept this request automatically'
+ page.should have_button 'Accept Merge Request'
end
step 'I modify merge commit message' do
@@ -170,7 +186,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
merge!: true,
)
- click_button "Accept Merge Request"
+ within '.can_be_merged' do
+ click_button "Accept Merge Request"
+ end
end
step 'I should see merged request' do
@@ -180,26 +198,24 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click link "Reopen"' do
- within '.page-title' do
- click_link "Reopen"
- end
+ first(:css, '.reopen-mr-link').click
end
step 'I should see reopened merge request "Bug NS-04"' do
- within '.state-label' do
+ within '.issue-box' do
page.should have_content "Open"
end
end
step 'I click link "Hide inline discussion" of the second file' do
within '.files [id^=diff]:nth-child(2)' do
- click_link "Diff comments"
+ click_link 'Show/Hide comments'
end
end
step 'I click link "Show inline discussion" of the second file' do
within '.files [id^=diff]:nth-child(2)' do
- click_link "Diff comments"
+ click_link 'Show/Hide comments'
end
end
@@ -210,7 +226,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I should see a comment like "Line is wrong" in the second file' do
- within '.files [id^=diff]:nth-child(2) .note-text' do
+ within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
page.should have_visible_content "Line is wrong"
end
end
@@ -222,7 +238,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I should see a comment like "Line is wrong here" in the second file' do
- within '.files [id^=diff]:nth-child(2) .note-text' do
+ within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do
page.should have_visible_content "Line is wrong here"
end
end
@@ -235,7 +251,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
click_button "Add Comment"
end
- within ".files [id^=diff]:nth-child(1) .note-text" do
+ within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do
page.should have_content "Line is correct"
end
end
@@ -250,7 +266,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I should still see a comment like "Line is correct" in the first file' do
- within '.files [id^=diff]:nth-child(1) .note-text' do
+ within '.files [id^=diff]:nth-child(1) .note-body > .note-text' do
page.should have_visible_content "Line is correct"
end
end
@@ -264,15 +280,19 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click Side-by-side Diff tab' do
- click_link 'Side-by-side Diff'
+ find('a', text: 'Side-by-side').trigger('click')
end
step 'I should see comments on the side-by-side diff page' do
- within '.files [id^=diff]:nth-child(1) .note-text' do
+ within '.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text' do
page.should have_visible_content "Line is correct"
end
end
+ step 'I fill in merge request search with "Fe"' do
+ fill_in 'issue_search', with: "Fe"
+ end
+
def merge_request
@merge_request ||= MergeRequest.find_by!(title: "Bug NS-05")
end