diaspora/features/support/publishing_cuke_helpers.rb
2012-02-06 12:25:02 -08:00

29 lines
No EOL
618 B
Ruby

module PublishingCukeHelpers
def make_post(text)
click_publisher
fill_in 'status_message_fake_text', :with => text
click_button :submit
end
def click_publisher
page.execute_script('
$("#publisher").removeClass("closed");
$("#publisher").find("textarea").focus();
')
end
def first_post_text
find('.stream_element:first .post-content').text()
end
def find_post_by_text(text)
find(".stream_element:contains('#{text}')")
end
def assert_nsfw(text)
post = find_post_by_text(text)
post.find(".shield").should be_present
end
end
World(PublishingCukeHelpers)