debian-mirror-gitlab/spec/helpers/rss_helper_spec.rb
2017-09-10 17:25:29 +05:30

20 lines
602 B
Ruby

require 'spec_helper'
describe RssHelper do
describe '#rss_url_options' do
context 'when signed in' do
it "includes the current_user's rss_token" do
current_user = create(:user)
allow(helper).to receive(:current_user).and_return(current_user)
expect(helper.rss_url_options).to include rss_token: current_user.rss_token
end
end
context 'when signed out' do
it "does not have an rss_token" do
allow(helper).to receive(:current_user).and_return(nil)
expect(helper.rss_url_options[:rss_token]).to be_nil
end
end
end
end