Last active
December 14, 2015 15:39
-
-
Save richdownie/5109880 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scenario: Verify activities and user_activities are created under the hood | |
* I register a new user in "(GMT-05:00) Eastern Time (US & Canada)" | |
* I verify activity count equals "0" | |
* I wait until "brand" "class" renders | |
* I verify user completed activities count equals "0" | |
* I wait until "brand" "class" renders | |
* I maximize browser | |
* I submit "new_link" "id" | |
* I fill in "activity_name" with "Outside Exercise" | |
* I submit "submit_form" "class" | |
* I verify activity count equals "1" | |
Given /I verify activity count equals "(.*)"/ do |count| | |
@browser.get(@localhost + "/check_user_activity?count=" + count) | |
end | |
class EngineTestController < ApplicationController | |
before_filter :fail_unless_in_development_mode | |
def check_user_activity | |
u = User.last | |
puts u.user_activities.count | |
raise "#{u.activities.count} You were expecting #{(params[:count]).to_i} user_activities.count" unless u.activities.count == (params[:count]).to_i | |
redirect_to activities_path | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment