summaryrefslogtreecommitdiff
path: root/spec/features
diff options
context:
space:
mode:
authorImre Farkas <ifarkas@gitlab.com>2018-05-31 14:01:04 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-31 14:01:04 +0000
commit20dfe25c151cc883ce0d38b67125b5ca41e6d422 (patch)
tree9a29f05a241713f3488e6bc2e5df03c07300ef45 /spec/features
parent2fdd8982f8204340e6413a57f46e6c41d8ecb429 (diff)
downloadgitlab-ce-20dfe25c151cc883ce0d38b67125b5ca41e6d422.tar.gz
Export assigned issues in iCalendar feed
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/atom/dashboard_issues_spec.rb12
-rw-r--r--spec/features/atom/dashboard_spec.rb6
-rw-r--r--spec/features/atom/issues_spec.rb13
-rw-r--r--spec/features/atom/users_spec.rb6
-rw-r--r--spec/features/dashboard/activity_spec.rb4
-rw-r--r--spec/features/dashboard/issues_filter_spec.rb6
-rw-r--r--spec/features/dashboard/issues_spec.rb4
-rw-r--r--spec/features/dashboard/projects_spec.rb2
-rw-r--r--spec/features/groups/activity_spec.rb8
-rw-r--r--spec/features/groups/issues_spec.rb16
-rw-r--r--spec/features/groups/show_spec.rb4
-rw-r--r--spec/features/ics/dashboard_issues_spec.rb65
-rw-r--r--spec/features/ics/group_issues_spec.rb67
-rw-r--r--spec/features/ics/project_issues_spec.rb66
-rw-r--r--spec/features/issues/filtered_search/filter_issues_spec.rb4
-rw-r--r--spec/features/issues_spec.rb14
-rw-r--r--spec/features/profile_spec.rb12
-rw-r--r--spec/features/projects/activity/rss_spec.rb4
-rw-r--r--spec/features/projects/commits/rss_spec.rb8
-rw-r--r--spec/features/projects/issues/rss_spec.rb8
-rw-r--r--spec/features/projects/show/rss_spec.rb4
-rw-r--r--spec/features/projects/tree/rss_spec.rb4
-rw-r--r--spec/features/users/rss_spec.rb4
23 files changed, 278 insertions, 63 deletions
diff --git a/spec/features/atom/dashboard_issues_spec.rb b/spec/features/atom/dashboard_issues_spec.rb
index fb6c71ce997..da7749b42d2 100644
--- a/spec/features/atom/dashboard_issues_spec.rb
+++ b/spec/features/atom/dashboard_issues_spec.rb
@@ -31,20 +31,20 @@ describe "Dashboard Issues Feed" do
expect(body).to have_selector('title', text: "#{user.name} issues")
end
- it "renders atom feed via RSS token" do
- visit issues_dashboard_path(:atom, rss_token: user.rss_token, assignee_id: user.id)
+ it "renders atom feed via feed token" do
+ visit issues_dashboard_path(:atom, feed_token: user.feed_token, assignee_id: user.id)
expect(response_headers['Content-Type']).to have_content('application/atom+xml')
expect(body).to have_selector('title', text: "#{user.name} issues")
end
it "renders atom feed with url parameters" do
- visit issues_dashboard_path(:atom, rss_token: user.rss_token, state: 'opened', assignee_id: user.id)
+ visit issues_dashboard_path(:atom, feed_token: user.feed_token, state: 'opened', assignee_id: user.id)
link = find('link[type="application/atom+xml"]')
params = CGI.parse(URI.parse(link[:href]).query)
- expect(params).to include('rss_token' => [user.rss_token])
+ expect(params).to include('feed_token' => [user.feed_token])
expect(params).to include('state' => ['opened'])
expect(params).to include('assignee_id' => [user.id.to_s])
end
@@ -53,7 +53,7 @@ describe "Dashboard Issues Feed" do
let!(:issue2) { create(:issue, author: user, assignees: [assignee], project: project2, description: 'test desc') }
it "renders issue fields" do
- visit issues_dashboard_path(:atom, rss_token: user.rss_token, assignee_id: assignee.id)
+ visit issues_dashboard_path(:atom, feed_token: user.feed_token, assignee_id: assignee.id)
entry = find(:xpath, "//feed/entry[contains(summary/text(),'#{issue2.title}')]")
@@ -76,7 +76,7 @@ describe "Dashboard Issues Feed" do
end
it "renders issue label and milestone info" do
- visit issues_dashboard_path(:atom, rss_token: user.rss_token, assignee_id: assignee.id)
+ visit issues_dashboard_path(:atom, feed_token: user.feed_token, assignee_id: assignee.id)
entry = find(:xpath, "//feed/entry[contains(summary/text(),'#{issue1.title}')]")
diff --git a/spec/features/atom/dashboard_spec.rb b/spec/features/atom/dashboard_spec.rb
index c6683bb3bc9..462eab07a75 100644
--- a/spec/features/atom/dashboard_spec.rb
+++ b/spec/features/atom/dashboard_spec.rb
@@ -13,9 +13,9 @@ describe "Dashboard Feed" do
end
end
- context "projects atom feed via RSS token" do
+ context "projects atom feed via feed token" do
it "renders projects atom feed" do
- visit dashboard_projects_path(:atom, rss_token: user.rss_token)
+ visit dashboard_projects_path(:atom, feed_token: user.feed_token)
expect(body).to have_selector('feed title')
end
end
@@ -29,7 +29,7 @@ describe "Dashboard Feed" do
project.add_master(user)
issue_event(issue, user)
note_event(note, user)
- visit dashboard_projects_path(:atom, rss_token: user.rss_token)
+ visit dashboard_projects_path(:atom, feed_token: user.feed_token)
end
it "has issue opened event" do
diff --git a/spec/features/atom/issues_spec.rb b/spec/features/atom/issues_spec.rb
index 525ce23aa56..ee3570a5b2b 100644
--- a/spec/features/atom/issues_spec.rb
+++ b/spec/features/atom/issues_spec.rb
@@ -45,10 +45,10 @@ describe 'Issues Feed' do
end
end
- context 'when authenticated via RSS token' do
+ context 'when authenticated via feed token' do
it 'renders atom feed' do
visit project_issues_path(project, :atom,
- rss_token: user.rss_token)
+ feed_token: user.feed_token)
expect(response_headers['Content-Type'])
.to have_content('application/atom+xml')
@@ -61,24 +61,23 @@ describe 'Issues Feed' do
end
it "renders atom feed with url parameters for project issues" do
- visit project_issues_path(project,
- :atom, rss_token: user.rss_token, state: 'opened', assignee_id: user.id)
+ visit project_issues_path(project, :atom, feed_token: user.feed_token, state: 'opened', assignee_id: user.id)
link = find('link[type="application/atom+xml"]')
params = CGI.parse(URI.parse(link[:href]).query)
- expect(params).to include('rss_token' => [user.rss_token])
+ expect(params).to include('feed_token' => [user.feed_token])
expect(params).to include('state' => ['opened'])
expect(params).to include('assignee_id' => [user.id.to_s])
end
it "renders atom feed with url parameters for group issues" do
- visit issues_group_path(group, :atom, rss_token: user.rss_token, state: 'opened', assignee_id: user.id)
+ visit issues_group_path(group, :atom, feed_token: user.feed_token, state: 'opened', assignee_id: user.id)
link = find('link[type="application/atom+xml"]')
params = CGI.parse(URI.parse(link[:href]).query)
- expect(params).to include('rss_token' => [user.rss_token])
+ expect(params).to include('feed_token' => [user.feed_token])
expect(params).to include('state' => ['opened'])
expect(params).to include('assignee_id' => [user.id.to_s])
end
diff --git a/spec/features/atom/users_spec.rb b/spec/features/atom/users_spec.rb
index 2d074c115dd..eeaaa40fe21 100644
--- a/spec/features/atom/users_spec.rb
+++ b/spec/features/atom/users_spec.rb
@@ -13,9 +13,9 @@ describe "User Feed" do
end
end
- context 'user atom feed via RSS token' do
+ context 'user atom feed via feed token' do
it "renders user atom feed" do
- visit user_path(user, :atom, rss_token: user.rss_token)
+ visit user_path(user, :atom, feed_token: user.feed_token)
expect(body).to have_selector('feed title')
end
end
@@ -51,7 +51,7 @@ describe "User Feed" do
issue_event(issue, user)
note_event(note, user)
merge_request_event(merge_request, user)
- visit user_path(user, :atom, rss_token: user.rss_token)
+ visit user_path(user, :atom, feed_token: user.feed_token)
end
it 'has issue opened event' do
diff --git a/spec/features/dashboard/activity_spec.rb b/spec/features/dashboard/activity_spec.rb
index a74a8aac2b2..941208fa244 100644
--- a/spec/features/dashboard/activity_spec.rb
+++ b/spec/features/dashboard/activity_spec.rb
@@ -12,8 +12,8 @@ feature 'Dashboard > Activity' do
visit activity_dashboard_path
end
- 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 "it has an RSS button with current_user's feed token"
+ it_behaves_like "an autodiscoverable RSS feed with current_user's feed token"
end
context 'event filters', :js do
diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb
index bab34ac9346..8d0b0be1bd4 100644
--- a/spec/features/dashboard/issues_filter_spec.rb
+++ b/spec/features/dashboard/issues_filter_spec.rb
@@ -47,15 +47,15 @@ feature 'Dashboard Issues filtering', :js do
it 'updates atom feed link' do
visit_issues(milestone_title: '', assignee_id: user.id)
- link = find('.nav-controls a[title="Subscribe"]')
+ link = find('.nav-controls a[title="Subscribe to RSS feed"]')
params = CGI.parse(URI.parse(link[:href]).query)
auto_discovery_link = find('link[type="application/atom+xml"]', visible: false)
auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query)
- expect(params).to include('rss_token' => [user.rss_token])
+ expect(params).to include('feed_token' => [user.feed_token])
expect(params).to include('milestone_title' => [''])
expect(params).to include('assignee_id' => [user.id.to_s])
- expect(auto_discovery_params).to include('rss_token' => [user.rss_token])
+ expect(auto_discovery_params).to include('feed_token' => [user.feed_token])
expect(auto_discovery_params).to include('milestone_title' => [''])
expect(auto_discovery_params).to include('assignee_id' => [user.id.to_s])
end
diff --git a/spec/features/dashboard/issues_spec.rb b/spec/features/dashboard/issues_spec.rb
index e41a2e4ce09..3cc7b38550d 100644
--- a/spec/features/dashboard/issues_spec.rb
+++ b/spec/features/dashboard/issues_spec.rb
@@ -56,8 +56,8 @@ RSpec.describe 'Dashboard Issues' do
expect(page).to have_current_path(issues_dashboard_url(assignee_id: current_user.id, state: 'closed'), url: true)
end
- 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 "it has an RSS button with current_user's feed token"
+ it_behaves_like "an autodiscoverable RSS feed with current_user's feed token"
end
describe 'new issue dropdown' do
diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb
index 257a3822503..ef2f0b5b31a 100644
--- a/spec/features/dashboard/projects_spec.rb
+++ b/spec/features/dashboard/projects_spec.rb
@@ -10,7 +10,7 @@ feature 'Dashboard Projects' do
sign_in(user)
end
- it_behaves_like "an autodiscoverable RSS feed with current_user's RSS token" do
+ it_behaves_like "an autodiscoverable RSS feed with current_user's feed token" do
before do
visit dashboard_projects_path
end
diff --git a/spec/features/groups/activity_spec.rb b/spec/features/groups/activity_spec.rb
index 7bc809b3104..0d7d3771071 100644
--- a/spec/features/groups/activity_spec.rb
+++ b/spec/features/groups/activity_spec.rb
@@ -15,8 +15,8 @@ feature 'Group activity page' do
visit path
end
- 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 "it has an RSS button with current_user's feed token"
+ it_behaves_like "an autodiscoverable RSS feed with current_user's feed token"
end
context 'when project is in the group', :js do
@@ -39,7 +39,7 @@ feature 'Group activity page' do
visit path
end
- 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 "it has an RSS button without a feed token"
+ it_behaves_like "an autodiscoverable RSS feed without a feed token"
end
end
diff --git a/spec/features/groups/issues_spec.rb b/spec/features/groups/issues_spec.rb
index 90bf7ba49f6..111a24c0d94 100644
--- a/spec/features/groups/issues_spec.rb
+++ b/spec/features/groups/issues_spec.rb
@@ -16,17 +16,21 @@ feature 'Group issues page' do
let(:access_level) { ProjectFeature::ENABLED }
context 'when signed in' do
- let(:user) { user_in_group }
-
- 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"
+ let(:user) do
+ user_in_group.ensure_feed_token
+ user_in_group.save!
+ user_in_group
+ end
+
+ it_behaves_like "it has an RSS button with current_user's feed token"
+ it_behaves_like "an autodiscoverable RSS feed with current_user's feed token"
end
context 'when signed out' do
let(:user) { nil }
- 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 "it has an RSS button without a feed token"
+ it_behaves_like "an autodiscoverable RSS feed without a feed token"
end
end
diff --git a/spec/features/groups/show_spec.rb b/spec/features/groups/show_spec.rb
index 3a0424d60f8..b7a7aa0e174 100644
--- a/spec/features/groups/show_spec.rb
+++ b/spec/features/groups/show_spec.rb
@@ -14,7 +14,7 @@ feature 'Group show page' do
visit path
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 feed token"
context 'when group does not exist' do
let(:path) { group_path('not-exist') }
@@ -29,7 +29,7 @@ feature 'Group show page' do
visit path
end
- it_behaves_like "an autodiscoverable RSS feed without an RSS token"
+ it_behaves_like "an autodiscoverable RSS feed without a feed token"
end
context 'when group has a public project', :js do
diff --git a/spec/features/ics/dashboard_issues_spec.rb b/spec/features/ics/dashboard_issues_spec.rb
new file mode 100644
index 00000000000..5d6cd44ad1c
--- /dev/null
+++ b/spec/features/ics/dashboard_issues_spec.rb
@@ -0,0 +1,65 @@
+require 'spec_helper'
+
+describe 'Dashboard Issues Calendar Feed' do
+ describe 'GET /issues' do
+ let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') }
+ let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') }
+ let!(:project) { create(:project) }
+
+ before do
+ project.add_master(user)
+ end
+
+ context 'when authenticated' do
+ it 'renders calendar feed' do
+ sign_in user
+ visit issues_dashboard_path(:ics)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ context 'when authenticated via personal access token' do
+ it 'renders calendar feed' do
+ personal_access_token = create(:personal_access_token, user: user)
+
+ visit issues_dashboard_path(:ics, private_token: personal_access_token.token)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ context 'when authenticated via feed token' do
+ it 'renders calendar feed' do
+ visit issues_dashboard_path(:ics, feed_token: user.feed_token)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ 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)
+ end
+
+ it 'renders issue fields' do
+ visit issues_dashboard_path(:ics, feed_token: user.feed_token)
+
+ expect(body).to have_text("SUMMARY:test title (in #{project.full_path})")
+ # line length for ics is 75 chars
+ expected_description = "DESCRIPTION:Find out more at #{issue_url(issue)}".insert(75, "\r\n")
+ expect(body).to have_text(expected_description)
+ expect(body).to have_text("DTSTART;VALUE=DATE:#{Date.tomorrow.strftime('%Y%m%d')}")
+ expect(body).to have_text("URL:#{issue_url(issue)}")
+ expect(body).to have_text('TRANSP:TRANSPARENT')
+ end
+ end
+ end
+end
diff --git a/spec/features/ics/group_issues_spec.rb b/spec/features/ics/group_issues_spec.rb
new file mode 100644
index 00000000000..0a049be2ffe
--- /dev/null
+++ b/spec/features/ics/group_issues_spec.rb
@@ -0,0 +1,67 @@
+require 'spec_helper'
+
+describe 'Group Issues Calendar Feed' do
+ describe 'GET /issues' do
+ let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') }
+ let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') }
+ let!(:group) { create(:group) }
+ let!(:project) { create(:project, group: group) }
+
+ before do
+ project.add_developer(user)
+ group.add_developer(user)
+ end
+
+ context 'when authenticated' do
+ it 'renders calendar feed' do
+ sign_in user
+ visit issues_group_path(group, :ics)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ context 'when authenticated via personal access token' do
+ it 'renders calendar feed' do
+ personal_access_token = create(:personal_access_token, user: user)
+
+ visit issues_group_path(group, :ics, private_token: personal_access_token.token)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ context 'when authenticated via feed token' do
+ it 'renders calendar feed' do
+ visit issues_group_path(group, :ics, feed_token: user.feed_token)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ 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)
+ end
+
+ it 'renders issue fields' do
+ visit issues_group_path(group, :ics, feed_token: user.feed_token)
+
+ expect(body).to have_text("SUMMARY:test title (in #{project.full_path})")
+ # line length for ics is 75 chars
+ expected_description = "DESCRIPTION:Find out more at #{issue_url(issue)}".insert(75, "\r\n")
+ expect(body).to have_text(expected_description)
+ expect(body).to have_text("DTSTART;VALUE=DATE:#{Date.tomorrow.strftime('%Y%m%d')}")
+ expect(body).to have_text("URL:#{issue_url(issue)}")
+ expect(body).to have_text('TRANSP:TRANSPARENT')
+ end
+ end
+ end
+end
diff --git a/spec/features/ics/project_issues_spec.rb b/spec/features/ics/project_issues_spec.rb
new file mode 100644
index 00000000000..b99e9607f1d
--- /dev/null
+++ b/spec/features/ics/project_issues_spec.rb
@@ -0,0 +1,66 @@
+require 'spec_helper'
+
+describe 'Project Issues Calendar Feed' do
+ describe 'GET /issues' do
+ let!(:user) { create(:user, email: 'private1@example.com', public_email: 'public1@example.com') }
+ let!(:assignee) { create(:user, email: 'private2@example.com', public_email: 'public2@example.com') }
+ let!(:project) { create(:project) }
+ let!(:issue) { create(:issue, author: user, assignees: [assignee], project: project) }
+
+ before do
+ project.add_developer(user)
+ end
+
+ context 'when authenticated' do
+ it 'renders calendar feed' do
+ sign_in user
+ visit project_issues_path(project, :ics)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ context 'when authenticated via personal access token' do
+ it 'renders calendar feed' do
+ personal_access_token = create(:personal_access_token, user: user)
+
+ visit project_issues_path(project, :ics, private_token: personal_access_token.token)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ context 'when authenticated via feed token' do
+ it 'renders calendar feed' do
+ visit project_issues_path(project, :ics, feed_token: user.feed_token)
+
+ expect(response_headers['Content-Type']).to have_content('text/calendar')
+ expect(response_headers['Content-Disposition']).to have_content('inline')
+ expect(body).to have_text('BEGIN:VCALENDAR')
+ end
+ end
+
+ 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)
+ end
+
+ it 'renders issue fields' do
+ visit project_issues_path(project, :ics, feed_token: user.feed_token)
+
+ expect(body).to have_text("SUMMARY:test title (in #{project.full_path})")
+ # line length for ics is 75 chars
+ expected_description = "DESCRIPTION:Find out more at #{issue_url(issue)}".insert(75, "\r\n")
+ expect(body).to have_text(expected_description)
+ expect(body).to have_text("DTSTART;VALUE=DATE:#{Date.tomorrow.strftime('%Y%m%d')}")
+ expect(body).to have_text("URL:#{issue_url(issue)}")
+ expect(body).to have_text('TRANSP:TRANSPARENT')
+ end
+ end
+ end
+end
diff --git a/spec/features/issues/filtered_search/filter_issues_spec.rb b/spec/features/issues/filtered_search/filter_issues_spec.rb
index 483122ae463..bc42618306f 100644
--- a/spec/features/issues/filtered_search/filter_issues_spec.rb
+++ b/spec/features/issues/filtered_search/filter_issues_spec.rb
@@ -468,13 +468,13 @@ describe 'Filter issues', :js do
it "for #{type}" do
visit path
- link = find_link('Subscribe')
+ link = find_link('Subscribe to RSS feed')
params = CGI.parse(URI.parse(link[:href]).query)
auto_discovery_link = find('link[type="application/atom+xml"]', visible: false)
auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query)
expected = {
- 'rss_token' => [user.rss_token],
+ 'feed_token' => [user.feed_token],
'milestone_title' => [milestone.title],
'assignee_id' => [user.id.to_s]
}
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
index e7f2e142b2d..c6dcd97631d 100644
--- a/spec/features/issues_spec.rb
+++ b/spec/features/issues_spec.rb
@@ -340,6 +340,20 @@ describe 'Issues' do
expect(page).to have_content('baz')
end
end
+
+ it 'filters by due next month and previous two weeks' do
+ foo.update(due_date: Date.today - 4.weeks)
+ bar.update(due_date: (Date.today + 2.months).beginning_of_month)
+ baz.update(due_date: Date.yesterday)
+
+ visit project_issues_path(project, due_date: Issue::DueNextMonthAndPreviousTwoWeeks.name)
+
+ page.within '.issues-holder' do
+ expect(page).not_to have_content('foo')
+ expect(page).not_to have_content('bar')
+ expect(page).to have_content('baz')
+ end
+ end
end
describe 'sorting by milestone' do
diff --git a/spec/features/profile_spec.rb b/spec/features/profile_spec.rb
index 15dcb30cbdd..2e0753c3bfb 100644
--- a/spec/features/profile_spec.rb
+++ b/spec/features/profile_spec.rb
@@ -56,21 +56,21 @@ describe 'Profile account page', :js do
end
end
- describe 'when I reset RSS token' do
+ describe 'when I reset feed token' do
before do
visit profile_personal_access_tokens_path
end
- it 'resets RSS token' do
- within('.rss-token-reset') do
- previous_token = find("#rss_token").value
+ it 'resets feed token' do
+ within('.feed-token-reset') do
+ previous_token = find("#feed_token").value
accept_confirm { click_link('reset it') }
- expect(find('#rss_token').value).not_to eq(previous_token)
+ expect(find('#feed_token').value).not_to eq(previous_token)
end
- expect(page).to have_content 'RSS token was successfully reset'
+ expect(page).to have_content 'Feed token was successfully reset'
end
end
diff --git a/spec/features/projects/activity/rss_spec.rb b/spec/features/projects/activity/rss_spec.rb
index cd1cfe07998..4ac34adde0e 100644
--- a/spec/features/projects/activity/rss_spec.rb
+++ b/spec/features/projects/activity/rss_spec.rb
@@ -15,7 +15,7 @@ feature 'Project Activity RSS' do
visit path
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 feed token"
end
context 'when signed out' do
@@ -23,6 +23,6 @@ feature 'Project Activity RSS' do
visit path
end
- it_behaves_like "it has an RSS button without an RSS token"
+ it_behaves_like "it has an RSS button without a feed token"
end
end
diff --git a/spec/features/projects/commits/rss_spec.rb b/spec/features/projects/commits/rss_spec.rb
index 0d9c7355ddd..0bc207da970 100644
--- a/spec/features/projects/commits/rss_spec.rb
+++ b/spec/features/projects/commits/rss_spec.rb
@@ -12,8 +12,8 @@ feature 'Project Commits RSS' do
visit path
end
- 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 "it has an RSS button with current_user's feed token"
+ it_behaves_like "an autodiscoverable RSS feed with current_user's feed token"
end
context 'when signed out' do
@@ -21,7 +21,7 @@ feature 'Project Commits RSS' do
visit path
end
- 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 "it has an RSS button without a feed token"
+ it_behaves_like "an autodiscoverable RSS feed without a feed token"
end
end
diff --git a/spec/features/projects/issues/rss_spec.rb b/spec/features/projects/issues/rss_spec.rb
index ff91aabc311..8b1f7d432ee 100644
--- a/spec/features/projects/issues/rss_spec.rb
+++ b/spec/features/projects/issues/rss_spec.rb
@@ -17,8 +17,8 @@ feature 'Project Issues RSS' do
visit path
end
- 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 "it has an RSS button with current_user's feed token"
+ it_behaves_like "an autodiscoverable RSS feed with current_user's feed token"
end
context 'when signed out' do
@@ -26,7 +26,7 @@ feature 'Project Issues RSS' do
visit path
end
- 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 "it has an RSS button without a feed token"
+ it_behaves_like "an autodiscoverable RSS feed without a feed token"
end
end
diff --git a/spec/features/projects/show/rss_spec.rb b/spec/features/projects/show/rss_spec.rb
index d02eaf34533..52164d30c40 100644
--- a/spec/features/projects/show/rss_spec.rb
+++ b/spec/features/projects/show/rss_spec.rb
@@ -12,7 +12,7 @@ feature 'Projects > Show > RSS' do
visit path
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 feed token"
end
context 'when signed out' do
@@ -20,6 +20,6 @@ feature 'Projects > Show > RSS' do
visit path
end
- it_behaves_like "an autodiscoverable RSS feed without an RSS token"
+ it_behaves_like "an autodiscoverable RSS feed without a feed token"
end
end
diff --git a/spec/features/projects/tree/rss_spec.rb b/spec/features/projects/tree/rss_spec.rb
index 6407370ac0d..f52b3cc1d86 100644
--- a/spec/features/projects/tree/rss_spec.rb
+++ b/spec/features/projects/tree/rss_spec.rb
@@ -12,7 +12,7 @@ feature 'Project Tree RSS' do
visit path
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 feed token"
end
context 'when signed out' do
@@ -20,6 +20,6 @@ feature 'Project Tree RSS' do
visit path
end
- it_behaves_like "an autodiscoverable RSS feed without an RSS token"
+ it_behaves_like "an autodiscoverable RSS feed without a feed token"
end
end
diff --git a/spec/features/users/rss_spec.rb b/spec/features/users/rss_spec.rb
index 7c5abe54d56..c3734b5c808 100644
--- a/spec/features/users/rss_spec.rb
+++ b/spec/features/users/rss_spec.rb
@@ -10,7 +10,7 @@ feature 'User RSS' do
visit path
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 feed token"
end
context 'when signed out' do
@@ -18,6 +18,6 @@ feature 'User RSS' do
visit path
end
- it_behaves_like "it has an RSS button without an RSS token"
+ it_behaves_like "it has an RSS button without a feed token"
end
end