debian-mirror-gitlab/spec/helpers/rss_helper_spec.rb

21 lines
606 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
describe RssHelper do
describe '#rss_url_options' do
context 'when signed in' do
2018-11-08 19:23:39 +05:30
it "includes the current_user's feed_token" do
2017-08-17 22:00:37 +05:30
current_user = create(:user)
allow(helper).to receive(:current_user).and_return(current_user)
2018-11-08 19:23:39 +05:30
expect(helper.rss_url_options).to include feed_token: current_user.feed_token
2017-08-17 22:00:37 +05:30
end
end
context 'when signed out' do
2018-11-08 19:23:39 +05:30
it "does not have a feed_token" do
2017-08-17 22:00:37 +05:30
allow(helper).to receive(:current_user).and_return(nil)
2018-11-08 19:23:39 +05:30
expect(helper.rss_url_options[:feed_token]).to be_nil
2017-08-17 22:00:37 +05:30
end
end
end
end