diff --git a/features/step_definitions/aspects_steps.rb b/features/step_definitions/aspects_steps.rb index 83539e80f..dc19ae17f 100644 --- a/features/step_definitions/aspects_steps.rb +++ b/features/step_definitions/aspects_steps.rb @@ -6,12 +6,12 @@ module AspectCukeHelpers def toggle_aspect(a_name) a_id = @me.aspects.where(name: a_name).pluck(:id).first aspect_css = ".dropdown li[data-aspect_id='#{a_id}']" - page.should have_selector(aspect_css) + expect(page).to have_selector(aspect_css) find(aspect_css).click end def aspect_dropdown_visible? - find('.aspect_membership.dropdown.active').should be_visible + expect(find('.aspect_membership.dropdown.active')).to be_visible end end World(AspectCukeHelpers) diff --git a/features/support/application_cuke_helpers.rb b/features/support/application_cuke_helpers.rb index c99ee66bc..f45054494 100644 --- a/features/support/application_cuke_helpers.rb +++ b/features/support/application_cuke_helpers.rb @@ -12,7 +12,7 @@ module ApplicationCukeHelpers end def flash_message_containing?(text) - flash_message(text: text).should be_visible + expect(flash_message(text: text)).to be_visible end def flash_message(opts={}) @@ -23,7 +23,7 @@ module ApplicationCukeHelpers def confirm_form_validation_error(element) is_invalid = page.evaluate_script("$('#{element}').is(':invalid')") - is_invalid.should be true + expect(is_invalid).to be true end def check_fields_validation_error(field_list) diff --git a/features/support/paths.rb b/features/support/paths.rb index df6774164..adc69649e 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -71,7 +71,7 @@ module NavigationHelpers def confirm_on_page(page_name) current_path = URI.parse(current_url).path - current_path.should == path_to(page_name) + expect(current_path).to eq(path_to(page_name)) end end diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index 316941f14..5e7e14e3e 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -8,7 +8,7 @@ module PublishingCukeHelpers elem.native.send_keys(' ' + txt) # make sure the other text field got the new contents - find('#status_message_text', visible: false).value.should include(txt) + expect(find('#status_message_text', visible: false).value).to include(txt) end def make_post(text) @@ -19,7 +19,7 @@ module PublishingCukeHelpers def submit_publisher txt = find('#publisher #status_message_fake_text').value find('#publisher .creation').click - page.should have_content(txt) unless page.has_css?('.nsfw-shield') + expect(page).to have_content(txt) unless page.has_css?('.nsfw-shield') end def click_and_post(text) @@ -42,19 +42,19 @@ module PublishingCukeHelpers def expand_first_post within(".stream_element", match: :first) do find(".expander").click - has_css?(".expander").should be false + expect(has_css?(".expander")).to be false end end def first_post_collapsed? - find(".stream_element .collapsible", match: :first).should have_css(".expander") - page.should have_css(".stream_element .collapsible.collapsed", match: :first) + expect(find(".stream_element .collapsible", match: :first)).to have_css(".expander") + expect(page).to have_css(".stream_element .collapsible.collapsed", match: :first) end def first_post_expanded? - page.should have_no_css(".stream_element .expander", match: :first) - page.should have_no_css(".stream_element .collapsible.collapsed", match: :first) - page.should have_css(".stream_element .collapsible.opened", match: :first) + expect(page).to have_no_css(".stream_element .expander", match: :first) + expect(page).to have_no_css(".stream_element .collapsible.collapsed", match: :first) + expect(page).to have_css(".stream_element .collapsible.opened", match: :first) end def first_post_text @@ -74,7 +74,7 @@ module PublishingCukeHelpers end def find_post_by_text(text) - page.should have_text(text) + expect(page).to have_text(text) find(".stream_element", text: text) end @@ -119,7 +119,7 @@ module PublishingCukeHelpers def assert_nsfw(text) post = find_post_by_text(text) - post.find(".nsfw-shield").should be_present + expect(post.find(".nsfw-shield")).to be_present end end diff --git a/features/support/user_cuke_helpers.rb b/features/support/user_cuke_helpers.rb index 0113dd076..056b12db9 100644 --- a/features/support/user_cuke_helpers.rb +++ b/features/support/user_cuke_helpers.rb @@ -105,12 +105,12 @@ module UserCukeHelpers end def confirm_getting_started_contents - page.should have_content("Well, hello there!") - page.should have_content("Who are you?") - page.should have_content("What are you into?") + expect(page).to have_content("Well, hello there!") + expect(page).to have_content("Who are you?") + expect(page).to have_content("What are you into?") # the username that was just entered for registration - page.should have_field("profile_first_name", with: @username) + expect(page).to have_field("profile_first_name", with: @username) end end