|
| 1 | +require File.dirname(__FILE__) + '/acceptance_helper' |
| 2 | + |
| 3 | +feature "Subscriptions" do |
| 4 | + |
| 5 | + scenario "Subscribing to a thread" do |
| 6 | + |
| 7 | +# Given I've commented in a thread |
| 8 | + thread = Factory(:discussion) |
| 9 | + me = Factory(:hacker) |
| 10 | + reply = Factory(:reply, :author => me.username, :author_email => me.email) |
| 11 | + thread.replies << reply |
| 12 | + |
| 13 | + Pony.should_receive(:deliver) do |mail| |
| 14 | + mail.to.should == [ me.email ] |
| 15 | + mail.body.to_s.should =~ /\/forums\/#{thread.forum}\/#{thread.slug}/ |
| 16 | + end |
| 17 | + |
| 18 | +# When someone else makes a comment |
| 19 | + somebody = Factory(:hacker) |
| 20 | + log_in somebody |
| 21 | + visit "/forums/#{thread.forum}/#{thread.slug}" |
| 22 | + click_link "Reply" |
| 23 | + fill_in "Body", :with => "Here's my take on things: Dream big!" |
| 24 | + click_button "Create Reply" |
| 25 | + |
| 26 | +# Then I should receive an email |
| 27 | +# (see pony block above) |
| 28 | + |
| 29 | +# And it should have a link to that thread |
| 30 | +# (see pony block above) |
| 31 | + |
| 32 | + end |
| 33 | + |
| 34 | +# Scenario: Unsubscribing from a thread |
| 35 | +# Given I've subscribed to a thread |
| 36 | +# And I'm on the page for that thread |
| 37 | +# When I click the unsubscribe link |
| 38 | +# And someone makes a comment |
| 39 | +# Then I should not receive an email |
| 40 | + |
| 41 | +# Scenario: Subscribing to a forum |
| 42 | +# Given I'm on the index page for a forum |
| 43 | +# When I click the subscription link |
| 44 | +# And someone makes a new thread in that forum |
| 45 | +# Then I should receive an email |
| 46 | +# And it should have a link to that forum |
| 47 | + |
| 48 | +# Scenario: Unsubscribing from a forum |
| 49 | +# Given I've subscribed to a forum |
| 50 | +# And I'm on the index page for that forum |
| 51 | +# When I click the unsubscribe link |
| 52 | +# And someone makes a new thread in that forum |
| 53 | +# Then I should not receive an email |
| 54 | + |
| 55 | +end |
0 commit comments