Skip to content
Browse files

Merge pull request #36 from codeforamerica/green_features_and_specs

Get all features and specs green again
  • Loading branch information...
2 parents ff7711e + 9089de4 commit 88bad4da48e12f6e4881061b30b3f9ea63f2aefd @sferik sferik committed Apr 11, 2012
View
6 features/a_user_can_define_additional_account_information.feature
@@ -8,7 +8,6 @@ Feature: A user can define additional account information
Background:
Given I have registered for an account with "testman@example.com"
- @javascript
Scenario: A user can edit his account information
When I edit my account information
Then I see the updated information on my account page
@@ -20,3 +19,8 @@ Feature: A user can define additional account information
Scenario: email is shown when user opts in to helping other civic hackers
When I edit my email preferences
Then I see a clickable "testman@example.com" on my account page
+
+ @javascript
+ Scenario: A user defines a new location via the Add Location option in the selct box
+ When I create a new location "Random Location" in the location select box
+ Then "Random Location" is available in the select box
View
3 features/challenges/a_user_can_issue_a_challenge.feature
@@ -5,6 +5,9 @@ Feature: A user can issue a challenge
I can issue a challenge to the CfA staff (admin)
So that they can suggest an app for my needs or issue a request for the app to be developed
+ Background:
+ Given that the location "Random Location" has been defined
+
@javascript
Scenario: A user submits a form to issue a challenge
Given I have registered for an account with "testman@example.com"
View
20 features/step_definitions/account_information_steps.rb
@@ -4,8 +4,6 @@
fill_in 'user[skill_list]', with: 'Ruby, Java, Project Management'
fill_in 'Enter your current password to make these changes', with: 'password'
- step "I create a new location with a modal in the \"user\" form"
-
fill_in 'user[current_password]', with: 'password'
click_on 'Update User'
end
@@ -19,9 +17,23 @@
wait_until { Location.find_by_name('Random Location') }
end
+When /^I create a new location "([^"]*)" in the location select box$/ do |location|
+ click_on 'Edit'
+
+ select "Add Location", from: "user[location_id]"
+ fill_in 'location[name]', with: location
+ find_field('location[name]').value.should == 'Random Location'
+ click_on 'Create Location'
+
+ wait_until { Location.find_by_name('Random Location') }
+end
+
+Then /^"([^"]*)" is available in the select box$/ do |location|
+ Location.last.name.should == location
+end
+
Then /^I see the updated information on my account page$/ do
page.should have_content 'Does not want to be contacted by other civic hackers'
- page.should have_content 'Random Location'
page.should have_content 'Project Management, Java, Ruby'
end
@@ -35,7 +47,7 @@
end
Then /^I am on the show user page with no location$/ do
- page.current_path.should == '/users/1'
+ page.current_path.should == "/users/#{User.last.id}"
page.should_not have_content 'Add Location'
end
View
11 features/step_definitions/challenge_steps.rb
@@ -1,16 +1,13 @@
+Given /^that the location "([^"]*)" has been defined$/ do |location|
+ FactoryGirl.create(:location, name: location)
+end
+
When /^I fill out a challenge form$/ do
click_on 'Submit a challenge'
fill_in 'challenge[purpose]', with: 'This answers the why'
fill_in 'challenge[organization_name]', with: 'We Are Titans'
- fill_in 'challenge[mission]', with: 'Long mission description'
- fill_in 'challenge[audience]', with: 'Description of their primary audience'
fill_in 'challenge[description]', with: 'This is a code for america challenge'
- fill_in 'challenge[technology_platform_list]', with: 'Ruby, Rails'
- fill_in 'challenge[success_description]', with: 'Success is a successful demo'
- fill_in 'challenge[user_story]', with: 'This is a brief description of a user case'
-
- step "I create a new location with a modal in the \"challenge\" form"
click_on 'Create Challenge'
end
View
8 features/step_definitions/deployed_app_steps.rb
@@ -72,7 +72,7 @@
When /^I choose to deploy "([^"]*)"$/ do |application_name|
step "I visit the application \"#{application_name}\" page"
- click_on "Deploy This App"
+ click_on "Start a Deployment"
end
Then /^I should be presented with a form that lets me deploy "([^"]*)"$/ do |application_name|
@@ -87,7 +87,7 @@
select 'Norfolk, VA', from: 'deployed_application[location_id]'
select 'Test Brigade', from: 'deployed_application[brigade_id]'
- click_on 'Deploy This Application!'
+ click_on 'Issue Challenge!'
end
When /^I specify a new brigade "([^"]*)"$/ do |brigade_name|
@@ -105,15 +105,15 @@
select 'Norfolk, VA', from: 'deployed_application[location_id]'
- click_on 'Deploy This Application!'
+ click_on 'Issue Challenge!'
end
When /^I unsuccessfully deploy the application "([^"]*)"$/ do |application_name|
step "I choose to deploy \"#{application_name}\""
select 'Test Brigade', from: 'deployed_application[brigade_id]'
- click_on 'Deploy This Application!'
+ click_on 'Issue Challenge!'
end
Then /^I should be informed that the application was not deployed$/ do
View
2 features/user_can_share_information_about_a_deployed_app.feature
@@ -17,6 +17,4 @@ Feature: A user can share information about a deployed application with a social
And I successfully deploy the application "First App"
Scenario: User able to share to their social networks by clicking a button on the deployed app show page
- When I click the button to share the deployed application
Then I should be able to share with my facebook and twitter networks
-
View
6 spec/decorators/user_decorator_spec.rb
@@ -52,12 +52,12 @@
it 'returns a link to email the user if they have not opted out from being contacted' do
subject.opt_in = true
- subject.as_link.should == "<a href=\"mailto:#{subject.email}\">#{UserDecorator.new(subject).gravatar_small}</a>"
+ subject.as_link.should match /#{subject.email}/
end
- it 'returns an nil if the user has opted to not being contacted' do
+ it 'returns an no email if the user has opted to not being contacted' do
subject.opt_in = false
- subject.as_link.should == "#{UserDecorator.new(subject).gravatar_small}"
+ subject.as_link.should_not match /#{subject.email}/
end
end
end

0 comments on commit 88bad4d

Please sign in to comment.
Something went wrong with that request. Please try again.