blob: a009f87ac6b9686547f456ad6e90ad3b221d9a2b (
plain)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe TrackHelper do
include TrackHelper
include LinkToHelper
describe 'when displaying notices for a search track' do
before do
@track_thing = FactoryGirl.build(:search_track)
end
it 'should create an already subscribed_notice' do
expected = %Q(You are already subscribed to <a href="/search/Example%20Query/newest/advanced">this search</a>)
already_subscribed_notice(@track_thing).should == expected
end
end
describe 'when displaying notices for a user track' do
before do
@track_thing = FactoryGirl.build(:user_track)
end
it 'should create an already subscribed_notice' do
expected = %Q(You are already subscribed to '#{user_link(@track_thing.tracked_user)}', a person)
already_subscribed_notice(@track_thing).should == expected
end
end
describe 'when displaying notices for a public body track' do
before do
@track_thing = FactoryGirl.build(:public_body_track)
end
it 'should create an already subscribed_notice' do
expected = %Q(You are already subscribed to '#{public_body_link(@track_thing.public_body)}', a public authority)
already_subscribed_notice(@track_thing).should == expected
end
end
describe 'when displaying notices for a successful request track' do
before do
@track_thing = FactoryGirl.build(:successful_request_track)
end
it 'should create an already subscribed_notice' do
expected = %Q(You are already subscribed to any <a href="/list/successful">successful requests</a>)
already_subscribed_notice(@track_thing).should == expected
end
end
describe 'when displaying notices for a new request track' do
before do
@track_thing = FactoryGirl.build(:new_request_track)
end
it 'should create an already subscribed_notice' do
expected = %Q(You are already subscribed to any <a href="/list">new requests</a>)
already_subscribed_notice(@track_thing).should == expected
end
end
describe 'when displaying notices for a request update track' do
before do
@track_thing = FactoryGirl.build(:request_update_track)
end
it 'should create an already subscribed_notice' do
expected = %Q(You are already subscribed to '#{request_link(@track_thing.info_request)}', a request)
already_subscribed_notice(@track_thing).should == expected
end
end
end
|