Skip to content

Instantly share code, notes, and snippets.

View yuvalkarmi's full-sized avatar

Yuval Karmi yuvalkarmi

  • Tel Aviv, Israel
View GitHub Profile
@user = User.find_by_username('foobar')
@user.reset_persistence_token
//login functionality here
@yuvalkarmi
yuvalkarmi / partial_app_template
Created November 27, 2010 04:51
Apply Application Templates to Existing Rails Applications
rake rails:template LOCATION=automate.rb
gem 'database_cleaner'
gem 'database_cleaner'
bundle install
bundle install
The model: 'the post: "foobar"' is not known in this scenario.
Given a teacher: "myteacher" exists with first_name: "Joe"
And I go to the home page
Then the teacher: "myteacher" should exist with first_name: "Joe"
Given a teacher: "myteacher" exists with first_name: "Joe"
And I go to the home page
Then the teacher: "myteacher" should exist with first_name: "Joe"
Given a post: "foobar" exists with title: "My awesome post"
And I go to the home page
Then the post: "foobar" should exist with title: "just a post"