summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2018-05-31 14:01:04 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-31 14:01:04 +0000
commit20dfe25c151cc883ce0d38b67125b5ca41e6d422 (patch)
tree9a29f05a241713f3488e6bc2e5df03c07300ef45 /spec/helpers
parent2fdd8982f8204340e6413a57f46e6c41d8ecb429 (diff)
downloadgitlab-ce-20dfe25c151cc883ce0d38b67125b5ca41e6d422.tar.gz
Export assigned issues in iCalendar feed
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/calendar_helper_spec.rb20
-rw-r--r--spec/helpers/rss_helper_spec.rb8
2 files changed, 24 insertions, 4 deletions
diff --git a/spec/helpers/calendar_helper_spec.rb b/spec/helpers/calendar_helper_spec.rb
new file mode 100644
index 00000000000..828a9d9fea0
--- /dev/null
+++ b/spec/helpers/calendar_helper_spec.rb
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe CalendarHelper do
+ 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
diff --git a/spec/helpers/rss_helper_spec.rb b/spec/helpers/rss_helper_spec.rb
index 269e1057e8d..a7f9bdf07e4 100644
--- a/spec/helpers/rss_helper_spec.rb
+++ b/spec/helpers/rss_helper_spec.rb
@@ -3,17 +3,17 @@ 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
+ 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.rss_url_options).to include rss_token: current_user.rss_token
+ expect(helper.rss_url_options).to include feed_token: current_user.feed_token
end
end
context 'when signed out' do
- it "does not have an rss_token" do
+ it "does not have a feed_token" do
allow(helper).to receive(:current_user).and_return(nil)
- expect(helper.rss_url_options[:rss_token]).to be_nil
+ expect(helper.rss_url_options[:feed_token]).to be_nil
end
end
end