2019-09-30 08:06:01 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-31 10:01:04 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe CalendarHelper do
|
2018-05-31 10:01:04 -04:00
|
|
|
describe '#calendar_url_options' do
|
|
|
|
context 'when signed in' do
|
|
|
|
it "includes the current_user's feed_token" do
|
|
|
|
current_user = create(:user)
|
|
|
|
allow(helper).to receive(:current_user).and_return(current_user)
|
|
|
|
expect(helper.calendar_url_options).to include feed_token: current_user.feed_token
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when signed out' do
|
|
|
|
it "does not have a feed_token" do
|
|
|
|
allow(helper).to receive(:current_user).and_return(nil)
|
|
|
|
expect(helper.calendar_url_options[:feed_token]).to be_nil
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|