diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2015-04-26 23:06:57 +0200 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-14 23:02:41 -0400 |
commit | a990ded930098b92fa0c0d0b14e09aa25341db42 (patch) | |
tree | 24b7fa4b9f7941479b7300d11ada806e50a9342d | |
parent | 6856d9d46751a47d4b08ea67cc49f8b88972f0e6 (diff) | |
download | gitlab-ce-a990ded930098b92fa0c0d0b14e09aa25341db42.tar.gz |
Made some more progress towards rspec 3
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
-rw-r--r-- | features/steps/project/merge_requests.rb | 30 | ||||
-rw-r--r-- | features/steps/project/project.rb | 2 | ||||
-rw-r--r-- | features/steps/shared/diff_note.rb | 4 |
3 files changed, 23 insertions, 13 deletions
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 62c64e60f6d..eb427d9c341 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -31,8 +31,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see closed merge request "Bug NS-04"' do merge_request = MergeRequest.find_by!(title: "Bug NS-04") - expect(merge_request.closed?).to be_true - expect(page).to have_content "Rejected by" + expect(merge_request).to be_closed + expect(page).to have_content 'Rejected by' end step 'I should see merge request "Bug NS-04"' do @@ -164,20 +164,26 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see a discussion has started on diff' do - expect(page).to have_content "#{current_user.name} started a discussion" - expect(page).to have_content sample_commit.line_code_path - expect(page).to have_content "Line is wrong" + page.within(".notes") do + page.should have_content "#{current_user.name} started a discussion" + page.should have_content sample_commit.line_code_path + page.should have_content "Line is wrong" + end end step 'I should see a discussion has started on commit diff' do - expect(page).to have_content "#{current_user.name} started a discussion on commit" - expect(page).to have_content sample_commit.line_code_path - expect(page).to have_content "Line is wrong" + page.within(".notes") do + page.should have_content "#{current_user.name} started a discussion on commit" + page.should have_content sample_commit.line_code_path + page.should have_content "Line is wrong" + end end step 'I should see a discussion has started on commit' do - expect(page).to have_content "#{current_user.name} started a discussion on commit" - expect(page).to have_content "One comment to rule them all" + page.within(".notes") do + page.should have_content "#{current_user.name} started a discussion on commit" + page.should have_content "One comment to rule them all" + end end step 'merge request is mergeable' do @@ -334,7 +340,9 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_button "Add Comment" end - expect(page).to have_content message + page.within(".notes-holder") do + page.should have_content message + end end def init_diff_note_first_file diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index ee4c7cd0f06..e4465a1c3b7 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -59,7 +59,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see the default project avatar' do - expect(@project.avatar?).to be_false + expect(@project.avatar?).to eq false end step 'I should not see the "Remove avatar" button' do diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index a716ca5837c..3fff49b5a1f 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -162,6 +162,8 @@ module SharedDiffNote end def click_diff_line(code) - find("button[data-line-code='#{code}']").click + within(".diff-content") do + find("button[data-line-code='#{code}']").click + end end end |