Commit a5fd190d33f140eba9345ac78655ed86ae5de104

Authored by Guilherme Rojas V. de Lima + João M. M. Silva
Committed by Guilherme Rojas
1 parent 7ef50bc0

Acceptance tests to project show action

Gemfile.lock
1 1 GIT
2 2 remote: https://github.com/mezuro/kalibro_entities.git
3   - revision: de2d51db42ddb77f3842eec2223c00b68a48222f
  3 + revision: c28d55fc1b02efc29eb5299b30da5d56f7d8c63f
4 4 specs:
5 5 kalibro_entities (0.0.1)
  6 + activesupport (~> 4.0.0)
6 7 savon (~> 2.3.0)
7 8  
8 9 GEM
... ... @@ -68,7 +69,7 @@ GEM
68 69 cucumber (>= 1.1.8)
69 70 nokogiri (>= 1.5.0)
70 71 database_cleaner (1.1.1)
71   - devise (3.0.2)
  72 + devise (3.0.3)
72 73 bcrypt-ruby (~> 3.0)
73 74 orm_adapter (~> 0.1)
74 75 railties (>= 3.2.6, < 5)
... ... @@ -187,7 +188,7 @@ GEM
187 188 actionpack (>= 3.0)
188 189 activesupport (>= 3.0)
189 190 sprockets (~> 2.8)
190   - sqlite3 (1.3.7)
  191 + sqlite3 (1.3.8)
191 192 therubyracer (0.11.4)
192 193 libv8 (~> 3.11.8.12)
193 194 ref
... ...
features/project.feature
... ... @@ -10,6 +10,35 @@ Feature: Project
10 10 And I should see Name
11 11 And I should see Description
12 12  
  13 + # This will fail until do the authentication to project.
  14 + @wip
13 15 Scenario: Should not create project without login
14 16 Given I am at the All Projects page
15   - Then I should not see New Project
16 17 \ No newline at end of file
  18 + Then I should not see New Project
  19 +
  20 + Scenario: Should list the existing projects
  21 + Given I am a regular user
  22 + And I am signed in
  23 + And I have a sample project
  24 + And I am at the All Projects page
  25 + Then the sample project should be there
  26 +
  27 + Scenario: Should show the existing project
  28 + Given I am a regular user
  29 + And I am signed in
  30 + And I have a sample project
  31 + And I am at the All Projects page
  32 + When I click the Show link
  33 + Then I should see Name
  34 + And I should see Description
  35 + And I should see Back
  36 + And the sample project should be there
  37 +
  38 + @wip
  39 + Scenario: Should back to the All Projects page from show project view
  40 + Given I am a regular user
  41 + And I am signed in
  42 + And I have a sample project
  43 + And I am at the Sample Project page
  44 + When I click the Back link
  45 + Then I should be in the All Projects page
... ...
features/step_definitions/project_steps.rb
... ... @@ -2,6 +2,23 @@ Given(/^I am at the All Projects page$/) do
2 2 visit projects_path
3 3 end
4 4  
  5 +Given(/^I have a sample project$/) do
  6 + @project = FactoryGirl.create(:project)
  7 +end
  8 +
  9 +Given(/^I am at the Sample Project page$/) do
  10 + visit "#{projects_path}/#{@project.id}"
  11 +end
  12 +
5 13 Then(/^I should not see (.+)$/) do |text|
6 14 page.should_not have_content(text)
7   -end
8 15 \ No newline at end of file
  16 +end
  17 +
  18 +Then(/^the sample project should be there$/) do
  19 + page.should have_content(@project.name)
  20 + page.should have_content(@project.description)
  21 +end
  22 +
  23 +Then(/^I should be in the All Projects page$/) do
  24 + page.should have_content("Listing Projects")
  25 +end
... ...