From 026e988544f282c87afec9a85ff21a23877f6226 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 12 Feb 2015 19:53:23 +0100 Subject: Even more hound fixes Signed-off-by: Jeroen van Baarsen --- spec/features/atom/dashboard_issues_spec.rb | 13 ++++++------ spec/features/atom/dashboard_spec.rb | 5 +++-- spec/features/atom/issues_spec.rb | 33 ++++++++++++++++------------- spec/features/atom/users_spec.rb | 18 ++++++++++------ 4 files changed, 40 insertions(+), 29 deletions(-) (limited to 'spec/features/atom') diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb index ceeb3e6c5aa..b710cb3c72f 100644 --- a/spec/features/atom/dashboard_issues_spec.rb +++ b/spec/features/atom/dashboard_issues_spec.rb @@ -17,12 +17,13 @@ describe "Dashboard Issues Feed", feature: true do it "should render atom feed via private token" do visit issues_dashboard_path(:atom, private_token: user.private_token) - expect(response_headers['Content-Type']).to have_content("application/atom+xml") - expect(body).to have_selector("title", text: "#{user.name} issues") - expect(body).to have_selector("author email", text: issue1.author_email) - expect(body).to have_selector("entry summary", text: issue1.title) - expect(body).to have_selector("author email", text: issue2.author_email) - expect(body).to have_selector("entry summary", text: issue2.title) + expect(response_headers['Content-Type']). + to have_content('application/atom+xml') + expect(body).to have_selector('title', text: "#{user.name} issues") + expect(body).to have_selector('author email', text: issue1.author_email) + expect(body).to have_selector('entry summary', text: issue1.title) + expect(body).to have_selector('author email', text: issue2.author_email) + expect(body).to have_selector('entry summary', text: issue2.title) end end end diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb index 8e723b5c2ac..ad157d742ff 100644 --- a/spec/features/atom/dashboard_spec.rb +++ b/spec/features/atom/dashboard_spec.rb @@ -7,7 +7,7 @@ describe "Dashboard Feed", feature: true do context "projects atom feed via private token" do it "should render projects atom feed" do visit dashboard_path(:atom, private_token: user.private_token) - expect(body).to have_selector("feed title") + expect(body).to have_selector('feed title') end end @@ -28,7 +28,8 @@ describe "Dashboard Feed", feature: true do end it "should have issue comment event" do - expect(body).to have_content("#{user.name} commented on issue ##{issue.iid}") + expect(body). + to have_content("#{user.name} commented on issue ##{issue.iid}") end end end diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb index 26422c8fdc0..43163e4113e 100644 --- a/spec/features/atom/issues_spec.rb +++ b/spec/features/atom/issues_spec.rb @@ -1,33 +1,36 @@ require 'spec_helper' -describe "Issues Feed", feature: true do - describe "GET /issues" do +describe 'Issues Feed', feature: true do + describe 'GET /issues' do let!(:user) { create(:user) } let!(:project) { create(:project) } let!(:issue) { create(:issue, author: user, project: project) } before { project.team << [user, :developer] } - context "when authenticated" do - it "should render atom feed" do + context 'when authenticated' do + it 'should render atom feed' do login_with user visit project_issues_path(project, :atom) - expect(response_headers['Content-Type']).to have_content("application/atom+xml") - expect(body).to have_selector("title", text: "#{project.name} issues") - expect(body).to have_selector("author email", text: issue.author_email) - expect(body).to have_selector("entry summary", text: issue.title) + expect(response_headers['Content-Type']). + to have_content('application/atom+xml') + expect(body).to have_selector('title', text: "#{project.name} issues") + expect(body).to have_selector('author email', text: issue.author_email) + expect(body).to have_selector('entry summary', text: issue.title) end end - context "when authenticated via private token" do - it "should render atom feed" do - visit project_issues_path(project, :atom, private_token: user.private_token) + context 'when authenticated via private token' do + it 'should render atom feed' do + visit project_issues_path(project, :atom, + private_token: user.private_token) - expect(response_headers['Content-Type']).to have_content("application/atom+xml") - expect(body).to have_selector("title", text: "#{project.name} issues") - expect(body).to have_selector("author email", text: issue.author_email) - expect(body).to have_selector("entry summary", text: issue.title) + expect(response_headers['Content-Type']). + to have_content('application/atom+xml') + expect(body).to have_selector('title', text: "#{project.name} issues") + expect(body).to have_selector('author email', text: issue.author_email) + expect(body).to have_selector('entry summary', text: issue.title) end end end diff --git a/spec/features/atom/users_spec.rb b/spec/features/atom/users_spec.rb index 37af48282db..c0316b073ad 100644 --- a/spec/features/atom/users_spec.rb +++ b/spec/features/atom/users_spec.rb @@ -4,17 +4,23 @@ describe "User Feed", feature: true do describe "GET /" do let!(:user) { create(:user) } - context "user atom feed via private token" do + context 'user atom feed via private token' do it "should render user atom feed" do visit user_path(user, :atom, private_token: user.private_token) - expect(body).to have_selector("feed title") + expect(body).to have_selector('feed title') end end context 'feed content' do let(:project) { create(:project) } - let(:issue) { create(:issue, project: project, author: user, description: '') } - let(:note) { create(:note, noteable: issue, author: user, note: 'Bug confirmed', project: project) } + let(:issue) do + create(:issue, project: project, + author: user, description: '') + end + let(:note) do + create(:note, noteable: issue, author: user, + note: 'Bug confirmed', project: project) + end before do project.team << [user, :master] @@ -23,11 +29,11 @@ describe "User Feed", feature: true do visit user_path(user, :atom, private_token: user.private_token) end - it "should have issue opened event" do + it 'should have issue opened event' do expect(body).to have_content("#{safe_name} opened issue ##{issue.iid}") end - it "should have issue comment event" do + it 'should have issue comment event' do expect(body). to have_content("#{safe_name} commented on issue ##{issue.iid}") end -- cgit v1.2.3