BigW Consortium Gitlab

rss_shared_examples.rb 941 Bytes
Newer Older
1 2
shared_examples "an autodiscoverable RSS feed with current_user's RSS token" do
  it "has an RSS autodiscovery link tag with current_user's RSS token" do
3
    expect(page).to have_css("link[type*='atom+xml'][href*='rss_token=#{user.rss_token}']", visible: false)
4 5 6
  end
end

7 8
shared_examples "it has an RSS button with current_user's RSS token" do
  it "shows the RSS button with current_user's RSS token" do
9
    expect(page).to have_css("a:has(.fa-rss)[href*='rss_token=#{user.rss_token}']")
10 11 12
  end
end

13 14
shared_examples "an autodiscoverable RSS feed without an RSS token" do
  it "has an RSS autodiscovery link tag without an RSS token" do
15
    expect(page).to have_css("link[type*='atom+xml']:not([href*='rss_token'])", visible: false)
16 17 18
  end
end

19 20
shared_examples "it has an RSS button without an RSS token" do
  it "shows the RSS button without an RSS token" do
21
    expect(page).to have_css("a:has(.fa-rss):not([href*='rss_token'])")
22 23
  end
end