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
FactoryGirl.define do | |
factory :currency do | |
name Forgery::Currency.description | |
sequence(:short_name) { |sn| "#{Forgery::Currency.code}#{sn}" } | |
symbol '$' | |
end | |
factory :price do | |
full_price { 6000 } | |
discount_price { 3000 } |
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
require 'mail' | |
class EmailValidator < ActiveModel::EachValidator | |
attr_reader :record, :attribute, :value, :email, :tree | |
def validate_each(record, attribute, value) | |
@record, @attribute, @value = record, attribute, value | |
@email = Mail::Address.new(value) | |
@tree = email.__send__(:tree) |
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
diff --git a/test/integration/rememberable_test.rb b/test/integration/rememberable_test.rb | |
index 14e66fb..295fab0 100644 | |
--- a/test/integration/rememberable_test.rb | |
+++ b/test/integration/rememberable_test.rb | |
@@ -54,6 +54,7 @@ class RememberMeTest < ActionController::IntegrationTest | |
test 'remember the user before sign in' do | |
user = create_user_and_remember | |
get users_path | |
assert_response :success |
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
# config/environment.rb | |
# ... | |
Dir[Rails.root + 'lib/monkey_patches/**/*.rb'].each { |file| require file } | |
# ... |