2017-02-28 15:50:57 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe RssHelper do
|
|
|
|
describe '#rss_url_options' do
|
|
|
|
context 'when signed in' do
|
2017-05-23 09:59:33 -04:00
|
|
|
it "includes the current_user's rss_token" do
|
2017-02-28 15:50:57 -05:00
|
|
|
current_user = create(:user)
|
|
|
|
allow(helper).to receive(:current_user).and_return(current_user)
|
2017-05-23 09:59:33 -04:00
|
|
|
expect(helper.rss_url_options).to include rss_token: current_user.rss_token
|
2017-02-28 15:50:57 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when signed out' do
|
2017-05-23 09:59:33 -04:00
|
|
|
it "does not have an rss_token" do
|
2017-02-28 15:50:57 -05:00
|
|
|
allow(helper).to receive(:current_user).and_return(nil)
|
2017-05-23 09:59:33 -04:00
|
|
|
expect(helper.rss_url_options[:rss_token]).to be_nil
|
2017-02-28 15:50:57 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|