posts_steps.rb 1.79 KB
Newer Older
1 2
Then /^the post "([^"]*)" should be marked nsfw$/ do |text|
  assert_nsfw(text)
3
end
4

5 6 7 8 9 10 11 12 13 14 15
Then /^the post should be collapsed$/ do
  find(".collapsible").should have_css(".expander")
  find(".collapsible").has_selector?(".collapsed")
end

Then /^the post should be expanded$/ do
  find(".expander").should_not be_visible
  find(".collapsible").has_no_selector?(".collapsed")
  find(".collapsible").has_selector?(".opened")
end

16 17
Then /^I should see an uploaded image within the photo drop zone$/ do
  find("#photodropzone img")["src"].should include("uploads/images")
18
end
Maxwell Salzberg's avatar
Maxwell Salzberg committed
19

20
Then /^I should not see an uploaded image within the photo drop zone$/ do
21
  all("#photodropzone img").should be_empty
22 23
end

24
Then /^I should not see any posts in my stream$/ do
25
  all(".stream_element").should be_empty
26 27
end

Maxwell Salzberg's avatar
Maxwell Salzberg committed
28 29 30 31
Given /^"([^"]*)" has a public post with text "([^"]*)"$/ do |email, text|
  user = User.find_by_email(email)
  user.post(:status_message, :text => text, :public => true, :to => user.aspects)
end
32 33 34 35 36 37

Given /^"([^"]*)" has a non public post with text "([^"]*)"$/ do |email, text|
  user = User.find_by_email(email)
  user.post(:status_message, :text => text, :public => false, :to => user.aspects)
end

38 39 40
When /^The user deletes their first post$/ do
  @me.posts.first.destroy
end
Dan Hansen's avatar
wip  
Dan Hansen committed
41

42
When /^I click on the first block button/ do
danielgrippi's avatar
danielgrippi committed
43 44
  find(".block_user").click
end
Maxwell Salzberg's avatar
Maxwell Salzberg committed
45

46 47 48 49
When /^I expand the post$/ do
  find(".expander").click
  wait_until{ !find(".expander").visible? }
end
Maxwell Salzberg's avatar
Maxwell Salzberg committed
50

Dennis Collinson's avatar
broken  
Dennis Collinson committed
51
Then /^I should see "([^"]*)" as the first post in my stream$/ do |text|
Maxwell Salzberg's avatar
Maxwell Salzberg committed
52 53 54
  first_post_text.should include(text)
end

Dennis Collinson's avatar
broken  
Dennis Collinson committed
55 56
When /^I post "([^"]*)"$/ do |text|
  click_and_post(text)
Maxwell Salzberg's avatar
Maxwell Salzberg committed
57 58
end

Dennis Collinson's avatar
broken  
Dennis Collinson committed
59 60
When /^I click the publisher and post "([^"]*)"$/ do |text|
  click_and_post(text)
61 62 63 64 65
end

When /^I post an extremely long status message$/ do
  click_and_post("I am a very interesting message " * 64)
end