ruby on rails - NameError: uninitialized constant Faker:: -
before(:all) puts "hello :d" end
i have problem code:
/spec/factories.rb
require 'faker' factorygirl.define factory :booking_error booking_id { faker::number.number(3).to_i } error_type_cd bookingerror.error_types.values.shuffle.first process_name enums::flightenum::processes.keys.shuffle.first description "description" old_value "old_string" new_value "new_string" end end
/spec/models/booking_error_spec.rb
require 'spec_helper' describe bookingerror before(:all) @booking_error = factorygirl.build(:booking_error) @booking_error_types = bookingerror.error_types end 'validating bookingerror save.' @booking_error.save.should be_true end end
gemfile
source 'https://rubygems.org' gem 'rails', '3.2.13' gem 'mysql2' , '0.3.11' gem 'devise' , '2.2.0.rc' gem 'devise-encryptable' , '0.1.1' gem 'unicorn' , '4.5.0' gem 'kaminari' , '0.14.1' gem 'memcache-client' , '1.8.5' gem 'simple_enum' , '1.6.4' gem 'resque' , '1.23.0' , :require => "resque/server" gem 'resque-logger' , '0.1.0' gem 'resque-workers-lock' gem 'whenever' , '0.8.1' , :require => false gem 'httparty' , '0.9.0' gem 'newrelic_rpm' , '3.6.1.88' gem 'cancan' , '1.6.8' gem 'rolify' , '3.2.0' gem 'json-schema' , '1.1.1' gem 'faker' , '1.1.2' gem 'ruby-enum' , '0.2.1' gem 'mail' , '2.5.4' gem 'daemons-rails' group :develop, :test gem 'capistrano' , '2.13.5' gem 'capistrano-unicorn' , '0.1.6' , :require => false gem 'capistrano-resque' , '~> 0.1.0' , :require => false gem 'rvm-capistrano' , '1.2.7' gem 'capistrano-ext' gem 'rspec-rails' , '2.12.0' gem 'debugger' , '1.5.0' gem 'thin' , '1.5.0' gem 'annotate' , '2.5.0' gem 'factory_girl_rails' , '4.1.0' gem 'yard' , '0.8.5.2' end # gems used assets , not required # in production environments default. group :assets gem 'therubyracer' , '0.10.2' gem 'coffee-rails' , '3.2.2' gem 'uglifier' , '1.3.0' gem 'twitter-bootstrap-rails' , '2.1.9' gem 'sass' , '3.2.4' gem 'jquery-ui-rails' , '3.0.0' gem 'less-rails' , '2.2.6' end gem 'jquery-rails' , '2.1.4'
when run:
$ rspec spec/models/booking_error_spec.rb
i error in title:
nameerror: uninitialized constant faker::number
number didn't exist in faker @ version using (1.1.2). update version 1.2.0 , work.
Comments
Post a Comment