summaryrefslogtreecommitdiff
path: root/spec/support/features/rss_shared_examples.rb
blob: 9a3b0a731ad5f97badc16449faf324a7c238b542 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
shared_examples "an autodiscoverable RSS feed with current_user's private token" do
  it "has an RSS autodiscovery link tag with current_user's private token" do
    expect(page).to have_css("link[type*='atom+xml'][href*='private_token=#{Thread.current[:current_user].private_token}']", visible: false)
  end
end

shared_examples "it has an RSS button with current_user's private token" do
  it "shows the RSS button with current_user's private token" do
    expect(page).to have_css("a:has(.fa-rss)[href*='private_token=#{Thread.current[:current_user].private_token}']")
  end
end

shared_examples "an autodiscoverable RSS feed without a private token" do
  it "has an RSS autodiscovery link tag without a private token" do
    expect(page).to have_css("link[type*='atom+xml']:not([href*='private_token'])", visible: false)
  end
end

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