debian-mirror-gitlab/spec/support/shared_examples/features/rss_shared_examples.rb

28 lines
1 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
2020-03-13 15:44:24 +05:30
RSpec.shared_examples "an autodiscoverable RSS feed with current_user's feed token" do
2018-11-08 19:23:39 +05:30
it "has an RSS autodiscovery link tag with current_user's feed token" do
expect(page).to have_css("link[type*='atom+xml'][href*='feed_token=#{user.feed_token}']", visible: false)
2017-08-17 22:00:37 +05:30
end
end
2020-03-13 15:44:24 +05:30
RSpec.shared_examples "it has an RSS button with current_user's feed token" do
2018-11-08 19:23:39 +05:30
it "shows the RSS button with current_user's feed token" do
2019-12-21 20:55:43 +05:30
expect(page)
2020-10-24 23:57:45 +05:30
.to have_css("a:has(.qa-rss-icon)[href*='feed_token=#{user.feed_token}']")
2017-08-17 22:00:37 +05:30
end
end
2020-03-13 15:44:24 +05:30
RSpec.shared_examples "an autodiscoverable RSS feed without a feed token" do
2018-11-08 19:23:39 +05:30
it "has an RSS autodiscovery link tag without a feed token" do
expect(page).to have_css("link[type*='atom+xml']:not([href*='feed_token'])", visible: false)
2017-08-17 22:00:37 +05:30
end
end
2020-03-13 15:44:24 +05:30
RSpec.shared_examples "it has an RSS button without a feed token" do
2018-11-08 19:23:39 +05:30
it "shows the RSS button without a feed token" do
2019-12-21 20:55:43 +05:30
expect(page)
2020-10-24 23:57:45 +05:30
.to have_css("a:has(.qa-rss-icon):not([href*='feed_token'])")
2017-08-17 22:00:37 +05:30
end
end