Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request to pass the cucumber features—improved #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions features/step_definitions/user_steps.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### UTILITY METHODS ###

def create_visitor
@visitor ||= { :name => "Testy McUserton", :email => "[email protected]",
@visitor ||= { :name => "testymcuserton", :email => "[email protected]",
:password => "changeme", :password_confirmation => "changeme" }
end

def find_user
@user ||= User.first conditions: {:email => @visitor[:email]}
@user ||= User.where('email' => @visitor[:email]).first
end

def create_unconfirmed_user
Expand All @@ -23,7 +23,7 @@ def create_user
end

def delete_user
@user ||= User.first conditions: {:email => @visitor[:email]}
find_user
@user.destroy unless @user.nil?
end

Expand Down Expand Up @@ -135,13 +135,11 @@ def sign_in
### THEN ###
Then /^I should be signed in$/ do
page.should have_content "Logout"
page.should_not have_content "Sign up"
page.should_not have_content "Login"
end

Then /^I should be signed out$/ do
page.should have_content "Sign up"
page.should have_content "Login"
page.should_not have_content "Logout"
end

Expand Down
5 changes: 1 addition & 4 deletions features/users/user_edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ Feature: Edit User
I want to edit my user profile
so I can change my username

Scenario: I sign in and edit my account
Given I am logged in
When I edit my account details
Then I should see an account edited message
# The username (a subdomain) cannot be edited.