Created
January 20, 2015 13:07
-
-
Save Grandvizir/3f5f11a74cf0498b2ae6 to your computer and use it in GitHub Desktop.
Rails initializers
This file contains 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
# test/controllers/users_controller_test.rb | |
class UsersControllerTest < ActionController::TestCase | |
setup do | |
@user_admin = User.find_by_email('[email protected]') #=> Not Find.. | |
@user = User.new(email: '[email protected]', name: 'Jean', token: 'plop', public_key: 'plip') | |
# test helper method | |
login_as(@user_admin) | |
end | |
end | |
# config/initializers/data_initializer.rb | |
User.create(email: '[email protected]', role: -1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment