diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-02-28 23:50:57 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-02-28 23:50:57 +0300 |
commit | a2670ee06b05c1abf31c11972319c6a59ef6940a (patch) | |
tree | 618c159bac47314bd0861ac79538ae44a365a869 /spec/helpers | |
parent | 05c8ec6cb85a3943b53cbd5757e7baea300dac68 (diff) |
Show public RSS feeds to anonymous users
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/rss_helper_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/rss_helper_spec.rb b/spec/helpers/rss_helper_spec.rb new file mode 100644 index 00000000000..f3f174f3d14 --- /dev/null +++ b/spec/helpers/rss_helper_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe RssHelper do + describe '#rss_url_options' do + context 'when signed in' do + it "includes the current_user's private_token" do + current_user = create(:user) + allow(helper).to receive(:current_user).and_return(current_user) + expect(helper.rss_url_options).to include private_token: current_user.private_token + end + end + + context 'when signed out' do + it "does not have a private_token" do + allow(helper).to receive(:current_user).and_return(nil) + expect(helper.rss_url_options[:private_token]).to be_nil + end + end + end +end |