/
refeed_item_spec.rb
45 lines (37 loc) · 1.01 KB
/
refeed_item_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'spec_helper'
describe "Refeeding an item" do
let!(:jeff) { FactoryGirl.create(:jeff) }
let!(:matt) { FactoryGirl.create(:matt) }
context "when I am logged in" do
before do
login('mattyoho', 'hungry')
end
context "when there is an item belonging to another user" do
before do
jeff.feed.feed_items << TextItem.new(:body => 'This is an item')
jeff.save
end
context "when I view that user's feed" do
before do
visit feed_path(jeff.feed)
end
it "I see a refeed button" do
within(".feed-item") do
page.should have_link('Refeed')
end
end
context "when I click to refeed" do
before do
within(".feed-item") do
click_link('Refeed')
end
end
it "shows up in my feed" do
visit feed_path(matt.feed)
page.should have_content "This is an item"
end
end
end
end
end
end