Commit dfc2542f authored by Alexis Reigel's avatar Alexis Reigel

use full caps RSS instead of rss

parent e209724f
--- ---
title: Expose atom links with an rss token instead of using the private token title: Expose atom links with an RSS token instead of using the private token
merge_request: 11647 merge_request: 11647
author: Alexis Reigel author: Alexis Reigel
...@@ -11,7 +11,7 @@ namespace :tokens do ...@@ -11,7 +11,7 @@ namespace :tokens do
reset_all_users_token(:reset_incoming_email_token!) reset_all_users_token(:reset_incoming_email_token!)
end end
desc "Reset all GitLab rss tokens" desc "Reset all GitLab RSS tokens"
task reset_all_rss: :environment do task reset_all_rss: :environment do
reset_all_users_token(:reset_rss_token!) reset_all_users_token(:reset_rss_token!)
end end
......
...@@ -100,14 +100,14 @@ describe ApplicationController do ...@@ -100,14 +100,14 @@ describe ApplicationController do
end end
describe '#authenticate_user_from_rss_token' do describe '#authenticate_user_from_rss_token' do
describe "authenticating a user from an rss token" do describe "authenticating a user from an RSS token" do
controller(described_class) do controller(described_class) do
def index def index
render text: 'authenticated' render text: 'authenticated'
end end
end end
context "when the 'rss_token' param is populated with the rss token" do context "when the 'rss_token' param is populated with the RSS token" do
context 'when the request format is atom' do context 'when the request format is atom' do
it "logs the user in" do it "logs the user in" do
get :index, rss_token: user.rss_token, format: :atom get :index, rss_token: user.rss_token, format: :atom
...@@ -125,7 +125,7 @@ describe ApplicationController do ...@@ -125,7 +125,7 @@ describe ApplicationController do
end end
end end
context "when the 'rss_token' param is populated with an invalid rss token" do context "when the 'rss_token' param is populated with an invalid RSS token" do
it "doesn't log the user" do it "doesn't log the user" do
get :index, rss_token: "token" get :index, rss_token: "token"
expect(response.status).not_to eq 200 expect(response.status).not_to eq 200
......
...@@ -20,7 +20,7 @@ describe "Dashboard Issues Feed", feature: true do ...@@ -20,7 +20,7 @@ describe "Dashboard Issues Feed", feature: true do
expect(body).to have_selector('title', text: "#{user.name} issues") expect(body).to have_selector('title', text: "#{user.name} issues")
end end
it "renders atom feed via rss token" do it "renders atom feed via RSS token" do
visit issues_dashboard_path(:atom, rss_token: user.rss_token) visit issues_dashboard_path(:atom, rss_token: user.rss_token)
expect(response_headers['Content-Type']).to have_content('application/atom+xml') expect(response_headers['Content-Type']).to have_content('application/atom+xml')
......
...@@ -11,7 +11,7 @@ describe "Dashboard Feed", feature: true do ...@@ -11,7 +11,7 @@ describe "Dashboard Feed", feature: true do
end end
end end
context "projects atom feed via rss token" do context "projects atom feed via RSS token" do
it "renders projects atom feed" do it "renders projects atom feed" do
visit dashboard_projects_path(:atom, rss_token: user.rss_token) visit dashboard_projects_path(:atom, rss_token: user.rss_token)
expect(body).to have_selector('feed title') expect(body).to have_selector('feed title')
......
...@@ -43,7 +43,7 @@ describe 'Issues Feed', feature: true do ...@@ -43,7 +43,7 @@ describe 'Issues Feed', feature: true do
end end
end end
context 'when authenticated via rss token' do context 'when authenticated via RSS token' do
it 'renders atom feed' do it 'renders atom feed' do
visit namespace_project_issues_path(project.namespace, project, :atom, visit namespace_project_issues_path(project.namespace, project, :atom,
rss_token: user.rss_token) rss_token: user.rss_token)
......
...@@ -11,7 +11,7 @@ describe "User Feed", feature: true do ...@@ -11,7 +11,7 @@ describe "User Feed", feature: true do
end end
end end
context 'user atom feed via rss token' do context 'user atom feed via RSS token' do
it "renders user atom feed" do it "renders user atom feed" do
visit user_path(user, :atom, rss_token: user.rss_token) visit user_path(user, :atom, rss_token: user.rss_token)
expect(body).to have_selector('feed title') expect(body).to have_selector('feed title')
......
...@@ -6,6 +6,6 @@ RSpec.describe 'Dashboard Activity', feature: true do ...@@ -6,6 +6,6 @@ RSpec.describe 'Dashboard Activity', feature: true do
visit activity_dashboard_path visit activity_dashboard_path
end end
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
...@@ -62,6 +62,6 @@ RSpec.describe 'Dashboard Issues', feature: true do ...@@ -62,6 +62,6 @@ RSpec.describe 'Dashboard Issues', feature: true do
expect(page).to have_content(other_issue.title) expect(page).to have_content(other_issue.title)
end end
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
...@@ -31,5 +31,5 @@ RSpec.describe 'Dashboard Projects', feature: true do ...@@ -31,5 +31,5 @@ RSpec.describe 'Dashboard Projects', feature: true do
end end
end end
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
...@@ -11,8 +11,8 @@ feature 'Group activity page', feature: true do ...@@ -11,8 +11,8 @@ feature 'Group activity page', feature: true do
visit path visit path
end end
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -20,7 +20,7 @@ feature 'Group activity page', feature: true do ...@@ -20,7 +20,7 @@ feature 'Group activity page', feature: true do
visit path visit path
end end
it_behaves_like "it has an RSS button without an rss token" it_behaves_like "it has an RSS button without an RSS token"
it_behaves_like "an autodiscoverable RSS feed without an rss token" it_behaves_like "an autodiscoverable RSS feed without an RSS token"
end end
end end
...@@ -12,15 +12,15 @@ feature 'Group issues page', feature: true do ...@@ -12,15 +12,15 @@ feature 'Group issues page', feature: true do
context 'when signed in' do context 'when signed in' do
let(:user) { user_in_group } let(:user) { user_in_group }
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
let(:user) { nil } let(:user) { nil }
it_behaves_like "it has an RSS button without an rss token" it_behaves_like "it has an RSS button without an RSS token"
it_behaves_like "an autodiscoverable RSS feed without an rss token" it_behaves_like "an autodiscoverable RSS feed without an RSS token"
end end
end end
......
...@@ -11,7 +11,7 @@ feature 'Group show page', feature: true do ...@@ -11,7 +11,7 @@ feature 'Group show page', feature: true do
visit path visit path
end end
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -19,6 +19,6 @@ feature 'Group show page', feature: true do ...@@ -19,6 +19,6 @@ feature 'Group show page', feature: true do
visit path visit path
end end
it_behaves_like "an autodiscoverable RSS feed without an rss token" it_behaves_like "an autodiscoverable RSS feed without an RSS token"
end end
end end
...@@ -16,7 +16,7 @@ feature 'Project Activity RSS' do ...@@ -16,7 +16,7 @@ feature 'Project Activity RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -24,6 +24,6 @@ feature 'Project Activity RSS' do ...@@ -24,6 +24,6 @@ feature 'Project Activity RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button without an rss token" it_behaves_like "it has an RSS button without an RSS token"
end end
end end
...@@ -12,8 +12,8 @@ feature 'Project Commits RSS' do ...@@ -12,8 +12,8 @@ feature 'Project Commits RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -21,7 +21,7 @@ feature 'Project Commits RSS' do ...@@ -21,7 +21,7 @@ feature 'Project Commits RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button without an rss token" it_behaves_like "it has an RSS button without an RSS token"
it_behaves_like "an autodiscoverable RSS feed without an rss token" it_behaves_like "an autodiscoverable RSS feed without an RSS token"
end end
end end
...@@ -16,8 +16,8 @@ feature 'Project Issues RSS' do ...@@ -16,8 +16,8 @@ feature 'Project Issues RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -25,7 +25,7 @@ feature 'Project Issues RSS' do ...@@ -25,7 +25,7 @@ feature 'Project Issues RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button without an rss token" it_behaves_like "it has an RSS button without an RSS token"
it_behaves_like "an autodiscoverable RSS feed without an rss token" it_behaves_like "an autodiscoverable RSS feed without an RSS token"
end end
end end
...@@ -12,7 +12,7 @@ feature 'Project RSS' do ...@@ -12,7 +12,7 @@ feature 'Project RSS' do
visit path visit path
end end
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -20,6 +20,6 @@ feature 'Project RSS' do ...@@ -20,6 +20,6 @@ feature 'Project RSS' do
visit path visit path
end end
it_behaves_like "an autodiscoverable RSS feed without an rss token" it_behaves_like "an autodiscoverable RSS feed without an RSS token"
end end
end end
...@@ -12,7 +12,7 @@ feature 'Project Tree RSS' do ...@@ -12,7 +12,7 @@ feature 'Project Tree RSS' do
visit path visit path
end end
it_behaves_like "an autodiscoverable RSS feed with current_user's rss token" it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -20,6 +20,6 @@ feature 'Project Tree RSS' do ...@@ -20,6 +20,6 @@ feature 'Project Tree RSS' do
visit path visit path
end end
it_behaves_like "an autodiscoverable RSS feed without an rss token" it_behaves_like "an autodiscoverable RSS feed without an RSS token"
end end
end end
...@@ -9,7 +9,7 @@ feature 'User RSS' do ...@@ -9,7 +9,7 @@ feature 'User RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button with current_user's rss token" it_behaves_like "it has an RSS button with current_user's RSS token"
end end
context 'when signed out' do context 'when signed out' do
...@@ -17,6 +17,6 @@ feature 'User RSS' do ...@@ -17,6 +17,6 @@ feature 'User RSS' do
visit path visit path
end end
it_behaves_like "it has an RSS button without an rss token" it_behaves_like "it has an RSS button without an RSS token"
end end
end end
shared_examples "an autodiscoverable RSS feed with current_user's rss token" do 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 it "has an RSS autodiscovery link tag with current_user's RSS token" do
expect(page).to have_css("link[type*='atom+xml'][href*='rss_token=#{Thread.current[:current_user].rss_token}']", visible: false) expect(page).to have_css("link[type*='atom+xml'][href*='rss_token=#{Thread.current[:current_user].rss_token}']", visible: false)
end end
end end
shared_examples "it has an RSS button with current_user's rss token" do 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 it "shows the RSS button with current_user's RSS token" do
expect(page).to have_css("a:has(.fa-rss)[href*='rss_token=#{Thread.current[:current_user].rss_token}']") expect(page).to have_css("a:has(.fa-rss)[href*='rss_token=#{Thread.current[:current_user].rss_token}']")
end end
end end
shared_examples "an autodiscoverable RSS feed without an rss token" do shared_examples "an autodiscoverable RSS feed without an RSS token" do
it "has an RSS autodiscovery link tag without an rss token" do it "has an RSS autodiscovery link tag without an RSS token" do
expect(page).to have_css("link[type*='atom+xml']:not([href*='rss_token'])", visible: false) expect(page).to have_css("link[type*='atom+xml']:not([href*='rss_token'])", visible: false)
end end
end end
shared_examples "it has an RSS button without an rss token" do shared_examples "it has an RSS button without an RSS token" do
it "shows the RSS button without an rss token" do it "shows the RSS button without an RSS token" do
expect(page).to have_css("a:has(.fa-rss):not([href*='rss_token'])") expect(page).to have_css("a:has(.fa-rss):not([href*='rss_token'])")
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment