Skip to content

Commit

Permalink
Remove view spec and replace it with improved Cucumber feature. [#54]
Browse files Browse the repository at this point in the history
  • Loading branch information
marnen committed Aug 6, 2013
1 parent a46ab79 commit 74501f2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 28 deletions.
10 changes: 6 additions & 4 deletions features/commitments/update_commitment_status.feature
Expand Up @@ -2,14 +2,15 @@ Feature: Update commitment status
In order to share commitment status with other users
any registered user should be able to
change his commitment status to any event on any subscribed calendar.

Scenario: Start out as uncommitted
Given I am logged in
And I am subscribed to "Calendar 1"
And someone else has an event called "Event" in "Calendar 1"
And I am on the event list
Then I should see "You are currently uncommitted."


@javascript
Scenario Outline: Change commitment status
Given I am logged in
And I am subscribed to "Calendar 1"
Expand All @@ -18,8 +19,9 @@ Feature: Update commitment status
When I select "<status>" from "status"
And I press "Change status"
Then I should see "You are currently <status>."

Examples:
| status |
| attending |
| not attending |
| not attending |
| uncommitted |
2 changes: 1 addition & 1 deletion features/step_definitions/calendar_steps.rb
Expand Up @@ -2,7 +2,7 @@

Given /^(I|"[^\"]*") (?:am|is) subscribed to "([^\"]*)"$/ do |user, calendar|
if user == 'I'
user = User.current_user
user = User.current_user || model!(:user)
else
names = user.gsub(/^"|"$/, '').split(' ', 2)
user = FactoryGirl.create :user, :firstname => names.first, :lastname => names.last
Expand Down
2 changes: 1 addition & 1 deletion features/step_definitions/user_steps.rb
Expand Up @@ -15,7 +15,7 @@
end

Given /^I am logged in$/ do
user = FactoryGirl.create :user, :password => 'passw0rd'
user = create_model :user, :password => 'passw0rd'
login_as user
end

Expand Down
2 changes: 2 additions & 0 deletions features/support/capybara-webkit.rb
@@ -1 +1,3 @@
require 'capybara/webkit'

Capybara.javascript_driver = :webkit
22 changes: 0 additions & 22 deletions spec/views/events/_attendance.html.haml_spec.rb

This file was deleted.

0 comments on commit 74501f2

Please sign in to comment.