diff options
Diffstat (limited to 'features/steps/shared')
-rw-r--r-- | features/steps/shared/active_tab.rb | 12 | ||||
-rw-r--r-- | features/steps/shared/authentication.rb | 2 | ||||
-rw-r--r-- | features/steps/shared/diff_note.rb | 18 | ||||
-rw-r--r-- | features/steps/shared/group.rb | 4 | ||||
-rw-r--r-- | features/steps/shared/markdown.rb | 4 | ||||
-rw-r--r-- | features/steps/shared/note.rb | 14 | ||||
-rw-r--r-- | features/steps/shared/paths.rb | 8 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 20 | ||||
-rw-r--r-- | features/steps/shared/project_tab.rb | 2 |
9 files changed, 42 insertions, 42 deletions
diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index 9beb688bd16..72d873caa57 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -2,27 +2,27 @@ module SharedActiveTab include Spinach::DSL def ensure_active_main_tab(content) - find('.nav-sidebar > li.active').should have_content(content) + expect(find('.nav-sidebar > li.active')).to have_content(content) end def ensure_active_sub_tab(content) - find('div.content ul.nav-tabs li.active').should have_content(content) + expect(find('div.content ul.nav-tabs li.active')).to have_content(content) end def ensure_active_sub_nav(content) - find('.sidebar-subnav > li.active').should have_content(content) + expect(find('.sidebar-subnav > li.active')).to have_content(content) end step 'no other main tabs should be active' do - page.should have_selector('.nav-sidebar > li.active', count: 1) + expect(page).to have_selector('.nav-sidebar > li.active', count: 1) end step 'no other sub tabs should be active' do - page.should have_selector('div.content ul.nav-tabs li.active', count: 1) + expect(page).to have_selector('div.content ul.nav-tabs li.active', count: 1) end step 'no other sub navs should be active' do - page.should have_selector('.sidebar-subnav > li.active', count: 1) + expect(page).to have_selector('.sidebar-subnav > li.active', count: 1) end step 'the active main tab should be Home' do diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb index ac8a3df6bb9..3c0f2a9406a 100644 --- a/features/steps/shared/authentication.rb +++ b/features/steps/shared/authentication.rb @@ -21,7 +21,7 @@ module SharedAuthentication end step 'I should be redirected to sign in page' do - current_path.should == new_user_session_path + expect(current_path).to eq new_user_session_path end step "I logout" do diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 510e0f0f938..5b75e45e18a 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -67,7 +67,7 @@ module SharedDiffNote step 'I should not see the diff comment form' do within(diff_file_selector) do - page.should_not have_css("form.new_note") + expect(page).not_to have_css("form.new_note") end end @@ -86,47 +86,47 @@ module SharedDiffNote step 'I should only see one diff form' do within(diff_file_selector) do - page.should have_css("form.new_note", count: 1) + expect(page).to have_css("form.new_note", count: 1) end end step 'I should see a diff comment form with ":-1: I don\'t like this"' do within(diff_file_selector) do - page.should have_field("note[note]", with: ":-1: I don\'t like this") + expect(page).to have_field("note[note]", with: ":-1: I don\'t like this") end end step 'I should see a diff comment saying "Typo, please fix"' do within("#{diff_file_selector} .note") do - page.should have_content("Typo, please fix") + expect(page).to have_content("Typo, please fix") end end step 'I should see a discussion reply button' do within(diff_file_selector) do - page.should have_button('Reply') + expect(page).to have_button('Reply') end end step 'I should see a temporary diff comment form' do within(diff_file_selector) do - page.should have_css(".js-temp-notes-holder form.new_note") + expect(page).to have_css(".js-temp-notes-holder form.new_note") end end step 'I should see add a diff comment button' do - page.should have_css('.js-add-diff-note-button', visible: true) + expect(page).to have_css('.js-add-diff-note-button', visible: true) end step 'I should see an empty diff comment form' do within(diff_file_selector) do - page.should have_field("note[note]", with: "") + expect(page).to have_field("note[note]", with: "") end end step 'I should see the cancel comment button' do within("#{diff_file_selector} form") do - page.should have_css(".js-close-discussion-note-form", text: "Cancel") + expect(page).to have_css(".js-close-discussion-note-form", text: "Cancel") end end diff --git a/features/steps/shared/group.rb b/features/steps/shared/group.rb index 1b225dd61a6..2d17fb34ccb 100644 --- a/features/steps/shared/group.rb +++ b/features/steps/shared/group.rb @@ -22,11 +22,11 @@ module SharedGroup end step 'I should see group "TestGroup"' do - page.should have_content "TestGroup" + expect(page).to have_content "TestGroup" end step 'I should not see group "TestGroup"' do - page.should_not have_content "TestGroup" + expect(page).not_to have_content "TestGroup" end protected diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb index 943640007a9..34172f5bb51 100644 --- a/features/steps/shared/markdown.rb +++ b/features/steps/shared/markdown.rb @@ -3,11 +3,11 @@ module SharedMarkdown def header_should_have_correct_id_and_link(level, text, id, parent = ".wiki") node = find("#{parent} h#{level} a##{id}") - node[:href].should == "##{id}" + expect(node[:href]).to eq "##{id}" # Work around a weird Capybara behavior where calling `parent` on a node # returns the whole document, not the node's actual parent element - find(:xpath, "#{node.path}/..").text.should == text + expect(find(:xpath, "#{node.path}/..").text).to eq text end step 'Header "Description header" should have correct id and link' do diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb index 2f66e61b214..59dca1db706 100644 --- a/features/steps/shared/note.rb +++ b/features/steps/shared/note.rb @@ -40,7 +40,7 @@ module SharedNote end step 'I should not see a comment saying "XML attached"' do - page.should_not have_css(".note") + expect(page).not_to have_css(".note") end step 'I should not see the cancel comment button' do @@ -70,13 +70,13 @@ module SharedNote step 'I should see a comment saying "XML attached"' do within(".note") do - page.should have_content("XML attached") + expect(page).to have_content("XML attached") end end step 'I should see an empty comment text field' do within(".js-main-target-form") do - page.should have_field("note[note]", with: "") + expect(page).to have_field("note[note]", with: "") end end @@ -101,7 +101,7 @@ module SharedNote step 'I should see comment "XML attached"' do within(".note") do - page.should have_content("XML attached") + expect(page).to have_content("XML attached") end end @@ -117,8 +117,8 @@ module SharedNote step 'The comment with the header should not have an ID' do within(".note-body > .note-text") do - page.should have_content("Comment with a header") - page.should_not have_css("#comment-with-a-header") + expect(page).to have_content("Comment with a header") + expect(page).not_to have_css("#comment-with-a-header") end end @@ -135,7 +135,7 @@ module SharedNote step 'I should see +1 in the description' do within(".note") do - page.should have_content("+1 Awesome!") + expect(page).to have_content("+1 Awesome!") end end end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 46493876805..09ae7e3a305 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -92,7 +92,7 @@ module SharedPaths end step 'I should be redirected to the dashboard groups page' do - current_path.should == dashboard_groups_path + expect(current_path).to eq dashboard_groups_path end step 'I visit dashboard starred projects page' do @@ -292,11 +292,11 @@ module SharedPaths end step 'I am on the new file page' do - current_path.should eq(namespace_project_create_blob_path(@project.namespace, @project, root_ref)) + expect(current_path).to eq(namespace_project_create_blob_path(@project.namespace, @project, root_ref)) end step 'I am on the ".gitignore" edit file page' do - current_path.should eq(namespace_project_edit_blob_path( + expect(current_path).to eq(namespace_project_edit_blob_path( @project.namespace, @project, File.join(root_ref, '.gitignore'))) end @@ -459,6 +459,6 @@ module SharedPaths # ---------------------------------------- step 'page status code should be 404' do - status_code.should == 404 + expect(status_code).to eq 404 end end diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index 3059c4ee041..9ee2e5dfbed 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -79,13 +79,13 @@ module SharedProject step 'I should see project "Shop" activity feed' do project = Project.find_by(name: "Shop") - page.should have_content "#{@user.name} pushed new branch fix at #{project.name_with_namespace}" + expect(page).to have_content "#{@user.name} pushed new branch fix at #{project.name_with_namespace}" end step 'I should see project settings' do - current_path.should == edit_namespace_project_path(@project.namespace, @project) - page.should have_content("Project name") - page.should have_content("Features:") + expect(current_path).to eq edit_namespace_project_path(@project.namespace, @project) + expect(page).to have_content("Project name") + expect(page).to have_content("Features:") end def current_project @@ -101,11 +101,11 @@ module SharedProject end step 'I should see project "Enterprise"' do - page.should have_content "Enterprise" + expect(page).to have_content "Enterprise" end step 'I should not see project "Enterprise"' do - page.should_not have_content "Enterprise" + expect(page).not_to have_content "Enterprise" end step 'internal project "Internal"' do @@ -113,11 +113,11 @@ module SharedProject end step 'I should see project "Internal"' do - page.should have_content "Internal" + expect(page).to have_content "Internal" end step 'I should not see project "Internal"' do - page.should_not have_content "Internal" + expect(page).not_to have_content "Internal" end step 'public project "Community"' do @@ -125,11 +125,11 @@ module SharedProject end step 'I should see project "Community"' do - page.should have_content "Community" + expect(page).to have_content "Community" end step 'I should not see project "Community"' do - page.should_not have_content "Community" + expect(page).not_to have_content "Community" end step '"John Doe" owns private project "Enterprise"' do diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb index 71fe89f634f..ce8cbe80aa8 100644 --- a/features/steps/shared/project_tab.rb +++ b/features/steps/shared/project_tab.rb @@ -46,7 +46,7 @@ module SharedProjectTab step 'the active main tab should be Settings' do within '.nav-sidebar' do - page.should have_content('Back to project') + expect(page).to have_content('Back to project') end end end |