Tests for dashboard projects fixed

This commit is contained in:
Andrew8xx8 2013-03-12 15:15:14 +04:00
parent 804ae05c58
commit fce22dfa2f
3 changed files with 9 additions and 7 deletions

View file

@ -1,4 +1,4 @@
Feature: Dashboard Feature: Dashboard projects
Background: Background:
Given I sign in as a user Given I sign in as a user
And I own project "Shop" And I own project "Shop"
@ -8,7 +8,5 @@ Feature: Dashboard
Then I should see projects list Then I should see projects list
Scenario: I should see project I am looking for Scenario: I should see project I am looking for
Given I search for "Sho" Given I search for "Sho"
Then I should see "Shop" project link Then I should see "Shop" project link

View file

@ -11,7 +11,10 @@ class Dashboard < Spinach::FeatureSteps
Given 'I search for "Sho"' do Given 'I search for "Sho"' do
fill_in "dashboard_projects_search", with: "Sho" fill_in "dashboard_projects_search", with: "Sho"
click_button "Search"
within ".dashboard-search-filter" do
find('button').click
end
end end
Then 'I should see "Shop" project link' do Then 'I should see "Shop" project link' do

View file

@ -9,7 +9,8 @@ module SharedProject
# Create a specific project called "Shop" # Create a specific project called "Shop"
And 'I own project "Shop"' do And 'I own project "Shop"' do
@project = create(:project, name: "Shop") @project = Project.find_by_name "Shop"
@project ||= create(:project, name: "Shop")
@project.team << [@user, :master] @project.team << [@user, :master]
end end