diff --git a/features/desktop/post_preview.feature b/features/desktop/post_preview.feature index 97d97d877..3585ceaf9 100644 --- a/features/desktop/post_preview.feature +++ b/features/desktop/post_preview.feature @@ -16,20 +16,17 @@ Feature: preview posts in the stream Scenario: preview and post a text-only message Given I expand the publisher - When I fill in the following: - | status_message_fake_text | I am eating yogurt | + When I write the status message "I am eating yogurt" And I press "Preview" Then "I am eating yogurt" should be post 1 And the first post should be a preview - When I fill in the following: - | status_message_fake_text | This preview rocks | + When I write the status message "This preview rocks" And I press "Preview" Then "This preview rocks" should be post 1 And I should not see "I am eating a yogurt" - When I fill in the following: - | status_message_fake_text | I like rocks | + When I write the status message "I like rocks" And I press "Share" Then "I like rocks" should be post 1 And I should not see "This preview rocks" diff --git a/features/step_definitions/mention_steps.rb b/features/step_definitions/mention_steps.rb index 237cd2857..e270ea875 100644 --- a/features/step_definitions/mention_steps.rb +++ b/features/step_definitions/mention_steps.rb @@ -7,7 +7,7 @@ end And /^I mention Alice in the publisher$/ do alice = User.find_by_email 'alice@alice.alice' - fill_in 'status_message_fake_text', :with => "@{Alice Smith ; #{alice.person.diaspora_handle}}" + write_in_publisher("@{Alice Smith ; #{alice.person.diaspora_handle}}") end And /^I click on the first user in the mentions dropdown list$/ do diff --git a/features/step_definitions/posts_steps.rb b/features/step_definitions/posts_steps.rb index 6c374296b..641229595 100644 --- a/features/step_definitions/posts_steps.rb +++ b/features/step_definitions/posts_steps.rb @@ -63,8 +63,12 @@ When /^I post an extremely long status message$/ do click_and_post("I am a very interesting message " * 64) end +When /^I write the status message "([^"]*)"$/ do |text| + write_in_publisher(text) +end + When /^I insert an extremely long status message$/ do - fill_in 'status_message_fake_text', :with => "I am a very interesting message " * 64 + write_in_publisher("I am a very interesting message " * 64) end When /^I open the show page of the "([^"]*)" post$/ do |post_text| diff --git a/features/step_definitions/stream_steps.rb b/features/step_definitions/stream_steps.rb index 4f36c979a..557e224ab 100644 --- a/features/step_definitions/stream_steps.rb +++ b/features/step_definitions/stream_steps.rb @@ -3,7 +3,7 @@ Then /^I like the post "([^"]*)"$/ do |post_text| end Then /^"([^"]*)" should be post (\d+)$/ do |post_text, position| - stream_element_numbers_content(position).text.should == post_text + stream_element_numbers_content(position).should have_content(post_text) end When /^I toggle nsfw posts$/ do diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index 90c0482e8..be13bae4e 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -1,6 +1,10 @@ module PublishingCukeHelpers + def write_in_publisher(txt) + fill_in 'status_message_fake_text', with: txt + end + def make_post(text) - fill_in 'status_message_fake_text', :with => text + write_in_publisher(txt) find(".creation").click page.should have_content text unless page.has_css? '.nsfw-shield' end