Commit fce22dfa2fe8dd0f551f0a24dae4a52d4096c6f1
1 parent
804ae05c
Exists in
master
and in
4 other branches
Tests for dashboard projects fixed
Showing
3 changed files
with
9 additions
and
7 deletions
Show diff stats
features/dashboard/projects.feature
| 1 | -Feature: Dashboard | |
| 1 | +Feature: Dashboard projects | |
| 2 | 2 | Background: |
| 3 | 3 | Given I sign in as a user |
| 4 | 4 | And I own project "Shop" |
| ... | ... | @@ -8,7 +8,5 @@ Feature: Dashboard |
| 8 | 8 | Then I should see projects list |
| 9 | 9 | |
| 10 | 10 | Scenario: I should see project I am looking for |
| 11 | - Given I search for "Sho" | |
| 12 | - Then I should see "Shop" project link | |
| 13 | - | |
| 14 | - | |
| 11 | + Given I search for "Sho" | |
| 12 | + Then I should see "Shop" project link | ... | ... |
features/steps/dashboard/dashboard_projects.rb
| ... | ... | @@ -11,7 +11,10 @@ class Dashboard < Spinach::FeatureSteps |
| 11 | 11 | |
| 12 | 12 | Given 'I search for "Sho"' do |
| 13 | 13 | fill_in "dashboard_projects_search", with: "Sho" |
| 14 | - click_button "Search" | |
| 14 | + | |
| 15 | + within ".dashboard-search-filter" do | |
| 16 | + find('button').click | |
| 17 | + end | |
| 15 | 18 | end |
| 16 | 19 | |
| 17 | 20 | Then 'I should see "Shop" project link' do | ... | ... |
features/steps/shared/project.rb
| ... | ... | @@ -9,7 +9,8 @@ module SharedProject |
| 9 | 9 | |
| 10 | 10 | # Create a specific project called "Shop" |
| 11 | 11 | And 'I own project "Shop"' do |
| 12 | - @project = create(:project, name: "Shop") | |
| 12 | + @project = Project.find_by_name "Shop" | |
| 13 | + @project ||= create(:project, name: "Shop") | |
| 13 | 14 | @project.team << [@user, :master] |
| 14 | 15 | end |
| 15 | 16 | ... | ... |