Commit b5aea848b610362710a54869a10b59e30a8ad6a0

Authored by Rafael Manzo
1 parent d7212652

Refactored "I should see" cucumber step

features/homepage.feature
... ... @@ -5,16 +5,16 @@ Feature: Homepage
5 5  
6 6 Scenario: Before signing in
7 7 Given I am at the homepage
8   - Then I should see Login
9   - And I should see Sign Up
10   - And I should see Latest projects
11   - And I should see Project
  8 + Then I should see "Login"
  9 + And I should see "Sign Up"
  10 + And I should see "Latest projects"
  11 + And I should see "Project"
12 12  
13 13 Scenario: Signed in
14 14 Given I am a regular user
15 15 And I am signed in
16 16 And I am at the homepage
17   - Then I should see Edit
18   - And I should see Logout
19   - And I should see Latest projects
20   - And I should see Project
21 17 \ No newline at end of file
  18 + Then I should see "Edit"
  19 + And I should see "Logout"
  20 + And I should see "Latest projects"
  21 + And I should see "Project"
22 22 \ No newline at end of file
... ...
features/project/create.feature
... ... @@ -8,7 +8,7 @@ Feature: Project Creation
8 8 Given I am at the All Projects page
9 9 When I click the New Project link
10 10 Then I should be in the Login page
11   - And I should see You need to sign in or sign up before continuing.
  11 + And I should see "You need to sign in or sign up before continuing."
12 12  
13 13 @kalibro_restart
14 14 Scenario: project creation
... ... @@ -18,8 +18,8 @@ Feature: Project Creation
18 18 And I fill the Name field with "Kalibro"
19 19 And I fill the Description field with "Web Service to collect metrics"
20 20 When I press the Save button
21   - Then I should see Kalibro
22   - And I should see Web Service to collect metrics
  21 + Then I should see "Kalibro"
  22 + And I should see "Web Service to collect metrics"
23 23  
24 24 @kalibro_restart
25 25 Scenario: project creation with already taken name
... ... @@ -30,7 +30,7 @@ Feature: Project Creation
30 30 And I fill the Name field with "Kalibro"
31 31 And I fill the Description field with "Web Service to collect metrics"
32 32 When I press the Save button
33   - Then I should see There's already
  33 + Then I should see "There's already"
34 34  
35 35 @kalibro_restart
36 36 Scenario: project creation with blank name
... ... @@ -40,4 +40,4 @@ Feature: Project Creation
40 40 And I fill the Name field with " "
41 41 And I fill the Description field with "Web Service to collect metrics"
42 42 When I press the Save button
43   - Then I should see Name can't be blank
44 43 \ No newline at end of file
  44 + Then I should see "Name can't be blank"
45 45 \ No newline at end of file
... ...
features/project/edition.feature
... ... @@ -27,7 +27,7 @@ Feature: Project
27 27 And I have a sample project
28 28 And I am at the All Projects page
29 29 When I visit the sample project edit page
30   - Then I should see You're not allowed to do this operation
  30 + Then I should see "You're not allowed to do this operation"
31 31  
32 32 @kalibro_restart
33 33 Scenario: Filling up the form
... ... @@ -48,8 +48,8 @@ Feature: Project
48 48 And I fill the Name field with "Kalibro"
49 49 And I fill the Description field with "Web Service to collect metrics"
50 50 When I press the Save button
51   - Then I should see Kalibro
52   - And I should see Web Service to collect metrics
  51 + Then I should see "Kalibro"
  52 + And I should see "Web Service to collect metrics"
53 53  
54 54 @kalibro_restart
55 55 Scenario: With project name already taken
... ... @@ -60,7 +60,7 @@ Feature: Project
60 60 And I am at the sample project edit page
61 61 And I fill the Name field with "Qt-Calculator"
62 62 When I press the Save button
63   - Then I should see There's already
  63 + Then I should see "There's already"
64 64  
65 65 @kalibro_restart
66 66 Scenario: Editing just the description
... ... @@ -70,7 +70,7 @@ Feature: Project
70 70 And I am at the sample project edit page
71 71 And I fill the Description field with "Web Service to collect metrics"
72 72 When I press the Save button
73   - And I should see Web Service to collect metrics
  73 + And I should see "Web Service to collect metrics"
74 74  
75 75 @kalibro_restart
76 76 Scenario: With blank project name
... ... @@ -80,4 +80,4 @@ Feature: Project
80 80 And I am at the sample project edit page
81 81 And I fill the Name field with " "
82 82 When I press the Save button
83   - Then I should see Name can't be blank
  83 + Then I should see "Name can't be blank"
... ...
features/project/listing.feature
... ... @@ -6,9 +6,9 @@ Feature: Project listing
6 6 Scenario: Listing projects
7 7 Given I am at the homepage
8 8 When I click the Project link
9   - Then I should see Listing Projects
10   - And I should see Name
11   - And I should see Description
  9 + Then I should see "Listing Projects"
  10 + And I should see "Name"
  11 + And I should see "Description"
12 12  
13 13 @kalibro_restart
14 14 Scenario: Should list the existing projects
... ... @@ -25,6 +25,6 @@ Feature: Project listing
25 25 And I have a sample project
26 26 And I am at the All Projects page
27 27 When I click the Show link
28   - Then I should see Name
29   - And I should see Description
  28 + Then I should see "Name"
  29 + And I should see "Description"
30 30 And the sample project should be there
31 31 \ No newline at end of file
... ...
features/step_definitions/homepage_steps.rb
... ... @@ -10,6 +10,6 @@ Given(/^I am a regular user$/) do
10 10 @user = FactoryGirl.create(:user)
11 11 end
12 12  
13   -Then(/^I should see (.+)$/) do |text|
  13 +Then(/^I should see "(.+)"$/) do |text|
14 14 page.should have_content(text)
15 15 end
16 16 \ No newline at end of file
... ...
features/user_update.feature
... ... @@ -11,5 +11,5 @@ Feature: User update
11 11 And I fill the Name field with "Rafael Manzo"
12 12 And I fill the Current password field with "password"
13 13 And I press the Update button
14   - Then I should see You updated your account successfully
  14 + Then I should see "You updated your account successfully"
15 15 And my name should have changed to Rafael Manzo
16 16 \ No newline at end of file
... ...
spec/factories/repositories.rb
... ... @@ -5,14 +5,14 @@ FactoryGirl.define do
5 5 description "A simple calculator"
6 6 license "GPLv3"
7 7 process_period 1
8   - type "SVN"
  8 + type "SUBVERSION"
9 9 address "svn://svn.code.sf.net/p/qt-calculator/code/trunk"
10 10 configuration_id 1
11 11 project_id 1
12 12 send_email "test@test.com"
13 13 end
14 14  
15   - factory :another_repository, class: KalibroEntities::Entities::Repository, parent: :repository do
  15 + factory :another_repository, class: Repository, parent: :repository do
16 16 id 2
17 17 end
18 18 end
19 19 \ No newline at end of file
... ...