diff options
Diffstat (limited to 'spec/features/ics/dashboard_issues_spec.rb')
-rw-r--r-- | spec/features/ics/dashboard_issues_spec.rb | 67 |
1 files changed, 43 insertions, 24 deletions
diff --git a/spec/features/ics/dashboard_issues_spec.rb b/spec/features/ics/dashboard_issues_spec.rb index 7115bd7dff7..00318f83105 100644 --- a/spec/features/ics/dashboard_issues_spec.rb +++ b/spec/features/ics/dashboard_issues_spec.rb @@ -29,9 +29,11 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'with no referer' do it 'renders calendar feed' do sign_in user - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date') + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date' + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -42,9 +44,11 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin it 'renders calendar feed as text/plain' do sign_in user page.driver.header('Referer', issues_dashboard_url(host: Settings.gitlab.base_url)) - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date') + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date' + ) expect(response_headers['Content-Type']).to have_content('text/plain') expect(body).to have_text('BEGIN:VCALENDAR') @@ -54,10 +58,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'when filtered by milestone' do it 'renders calendar feed' do sign_in user - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - milestone_title: milestone.title) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + milestone_title: milestone.title + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -69,10 +75,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin it 'renders calendar feed' do personal_access_token = create(:personal_access_token, user: user) - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - private_token: personal_access_token.token) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + private_token: personal_access_token.token + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -81,10 +89,12 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'when authenticated via feed token' do it 'renders calendar feed' do - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - feed_token: user.feed_token) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + feed_token: user.feed_token + ) expect(response_headers['Content-Type']).to have_content('text/calendar') expect(body).to have_text('BEGIN:VCALENDAR') @@ -93,15 +103,24 @@ RSpec.describe 'Dashboard Issues Calendar Feed', feature_category: :team_plannin context 'issue with due date' do let!(:issue) do - create(:issue, author: user, assignees: [assignee], project: project, title: 'test title', - description: 'test desc', due_date: Date.tomorrow) + create( + :issue, + author: user, + assignees: [assignee], + project: project, + title: 'test title', + description: 'test desc', + due_date: Date.tomorrow + ) end it 'renders issue fields' do - visit issues_dashboard_path(:ics, - due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, - sort: 'closest_future_date', - feed_token: user.feed_token) + visit issues_dashboard_path( + :ics, + due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name, + sort: 'closest_future_date', + feed_token: user.feed_token + ) expect(body).to have_text("SUMMARY:test title (in #{project.full_path})") # line length for ics is 75 chars |