Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-16 01:26:30 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-02-20 17:10:26 +0300
commitb05ab108f8f054e137d6ca3df9c211152afa23c7 (patch)
tree7e1447e93b2f26baa788352a8e1742fdaaeadac0 /features/steps
parent38026e5f7708473d2ae7a284a174fea7dac1e5db (diff)
Add feature spec for task queue list page
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/dashboard/task_queue.rb60
-rw-r--r--features/steps/shared/paths.rb4
2 files changed, 64 insertions, 0 deletions
diff --git a/features/steps/dashboard/task_queue.rb b/features/steps/dashboard/task_queue.rb
new file mode 100644
index 00000000000..8695dd5cfb1
--- /dev/null
+++ b/features/steps/dashboard/task_queue.rb
@@ -0,0 +1,60 @@
+class Spinach::Features::DashboardTaskQueue < Spinach::FeatureSteps
+ include SharedAuthentication
+ include SharedPaths
+ include SharedProject
+ include SharedUser
+
+ step '"John Doe" is a developer of project "Shop"' do
+ project.team << [john_doe, :developer]
+ end
+
+ step 'I have pending tasks' do
+ create(:task, user: current_user, project: project, author: john_doe, target: assigned_issue, action: Task::ASSIGNED)
+ end
+
+ step 'I should see pending tasks assigned to me' do
+ expect(page).to have_link 'Tasks (1)'
+ expect(page).to have_link 'Done (0)'
+
+ page.within('.tasks') do
+ expect(page).to have_content project.name_with_namespace
+ expect(page).to have_content "John Doe assigned issue ##{assigned_issue.iid}"
+ expect(page).to have_content(assigned_issue.title[0..10])
+ expect(page).to have_link 'Done'
+ end
+ end
+
+ step 'I mark the pending task as done' do
+ click_link 'Done'
+
+ expect(page).to have_content 'Task was successfully marked as done.'
+ expect(page).to have_link 'Tasks (0)'
+ expect(page).to have_link 'Done (1)'
+ expect(page).to have_content 'No tasks to show'
+ end
+
+ step 'I click on the "Done" tab' do
+ click_link 'Done (1)'
+ end
+
+ step 'I should see all tasks marked as done' do
+ page.within('.tasks') do
+ expect(page).to have_content project.name_with_namespace
+ expect(page).to have_content "John Doe assigned issue ##{assigned_issue.iid}"
+ expect(page).to have_content(assigned_issue.title[0..10])
+ expect(page).not_to have_link 'Done'
+ end
+ end
+
+ def assigned_issue
+ @assigned_issue ||= create(:issue, assignee: current_user, project: project)
+ end
+
+ def john_doe
+ @john_doe ||= user_exists("John Doe", { username: "john_doe" })
+ end
+
+ def project
+ @project ||= create(:project, name: "Shop")
+ end
+end
diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb
index 2c854ac7bf9..112ace342f0 100644
--- a/features/steps/shared/paths.rb
+++ b/features/steps/shared/paths.rb
@@ -103,6 +103,10 @@ module SharedPaths
visit dashboard_groups_path
end
+ step 'I visit dashboard task queue page' do
+ visit dashboard_tasks_path
+ end
+
step 'I should be redirected to the dashboard groups page' do
expect(current_path).to eq dashboard_groups_path
end