From b8d73315f5e094906111ab16607b5fa2685d2ea8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 9 Mar 2015 14:25:14 -0700 Subject: [PATCH] Add tests for starred projects page --- features/dashboard/starred_projects.feature | 12 ++++++++++++ features/steps/dashboard/starred_projects.rb | 15 +++++++++++++++ features/steps/shared/paths.rb | 4 ++++ 3 files changed, 31 insertions(+) create mode 100644 features/dashboard/starred_projects.feature create mode 100644 features/steps/dashboard/starred_projects.rb diff --git a/features/dashboard/starred_projects.feature b/features/dashboard/starred_projects.feature new file mode 100644 index 0000000000..9dfd2fbab9 --- /dev/null +++ b/features/dashboard/starred_projects.feature @@ -0,0 +1,12 @@ +@dashboard +Feature: Dashboard Starred Projects + Background: + Given I sign in as a user + And public project "Community" + And I starred project "Community" + And I own project "Shop" + And I visit dashboard starred projects page + + Scenario: I should see projects list + Then I should see project "Community" + And I should not see project "Shop" diff --git a/features/steps/dashboard/starred_projects.rb b/features/steps/dashboard/starred_projects.rb new file mode 100644 index 0000000000..b9ad2f13e2 --- /dev/null +++ b/features/steps/dashboard/starred_projects.rb @@ -0,0 +1,15 @@ +class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedProject + + step 'I starred project "Community"' do + current_user.toggle_star(Project.find_by(name: 'Community')) + end + + step 'I should not see project "Shop"' do + within 'aside' do + page.should_not have_content('Shop') + end + end +end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index db6417bf95..bb6c336d7c 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -95,6 +95,10 @@ module SharedPaths current_path.should == dashboard_groups_path end + step 'I visit dashboard starred projects page' do + visit starred_dashboard_projects_path + end + # ---------------------------------------- # Profile # ----------------------------------------