search for: factory_girl

Displaying 20 results from an estimated 29 matches for "factory_girl".

2010 Sep 27
3
having some issues with factory_girl and bundler...
Hi All Need some brilliants minds here :) I''m using Rails 2.3.8 & ruby 1.8 (I know, I know... ) I''ve move my gems from .gems to Bundler, but I''m having some issues with Factory_girl when I rake spec "uninitialized constant Factory" I''m following the instructions from http://gembundler.com/rails23.html. Basically: - grab all config.gem and place them into Gemfile - bundle install - check Gemfile.lock in my repository .. etc I even tried with a new dummy a...
2011 Aug 09
0
Devise, RSpec and Webrat
...39; devise (1.0.9) app/models/devise_mailer.rb:31:in `setup_mail'' devise (1.0.9) app/models/devise_mailer.rb:7:in `confirmation_instructions'' devise (1.0.9) lib/devise/models/confirmable.rb:61:in `send_confirmation_instructions'' /usr/lib/ruby/gems/1.8/gems/factory_girl-2.0.3/lib/factory_girl/ proxy/create.rb:9:in `result'' /usr/lib/ruby/gems/1.8/gems/factory_girl-2.0.3/lib/factory_girl/ factory.rb:86:in `run'' /usr/lib/ruby/gems/1.8/gems/factory_girl-2.0.3/lib/factory_girl/ syntax/methods.rb:54:in `create'' /usr/lib/ruby/gems/1...
2010 Feb 04
2
preload test data from factory_girl
Is there a way to preload common data made by factory_girl to speed up tests instead of recreating these common data at the beginning of every test. For example, I want to have 10 users premade at the beginning of every test. I found this http://agilewebdevelopment.com/plugins/factory_data_preloader But the page says that this plugin does not "play...
2010 Feb 12
1
Why does config.gem mess up migration?
...active_record/ connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache'' I looked at the environment.rb and noticed one thing that was "abnormal" from my experience. I had cut-pasted the following config.gem line: config.gem ''thoughtbot-factory_girl'', :lib => ''factory_girl'', :source => ''http://gems.github.com'' So I changed it to config.gem ''thoughtbot-factory_girl'', :lib =>false, :source => ''http://gems.github.com'' to look like the other config.gem...
2010 Jun 03
2
creating fixtures for has_many :through
...user: users(:superuser) role: roles(:user) ==== ... but no combination of "roles(:user)", "roles(:user).find", "roles(:user).find.id" etc appears to create the correct associations. Before Marnen tells me to put aside my Luddite tendencies and that I should learn factory_girl or Machinist or the next testing framework du jour, is there any sensible way to do this using fixtures? - ff -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send...
2013 Mar 28
0
Can not determine issue in my factories with factory girl in rspec
...n of 1.9.2, and passing for 1.9.3. However build 65 is failing to run specs against ruby version of 1.9.3, and passing for 1.9.2. And there is no change in code at all for both the builds. However, for both builds which are failing throw the same error: /home/travis/.rvm/gems/ruby-1.9.2-p320/gems/factory_girl-4.2.0/lib/factory_girl/registry.rb:24:in `find'': Factory not registered: active_sale (ArgumentError) from /home/travis/.rvm/gems/ruby-1.9.2-p320/gems/factory_girl-4.2.0/lib/factory_girl/decorator.rb:10:in `method_missing'' Since, the code is very long. I''ll reference it...
2010 Sep 25
3
Factory_girl association with specific values
Hope this should be simple: I have a User model and a Role model. Factories for each. When I create a User using FG, I want to assign a specific role. Cant seem to figure out how to do this, getting errors like: uninitialized constant SysadminRole for doing things this way: Factory.define :user do |u| u.practice_id { |a| a.association(:practice).id } u.password ''password1''
2012 Apr 25
2
Test oddities
Can someone explain why a instance variable cannot be changed through an association under rspec/factory_girl? An example is in this gist<https://gist.github.com/2484336> . All tests pass except the last. All the steps pass in the console. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit htt...
2011 Jan 20
11
RSpec / Cucumber painfully slow Rails 3 OSX
I am working on my first Rails BDD project with extensive tests since starting out with Rails a few years ago. Running RSpec or Cucumber is really slow. I''m using Rails 3 and RSpec 2. To run one model spec with only 5 tests takes almost 1 minute! When it finishes it says it took only 0.9 seconds to run the actual test. So obviously it is loading the environment that takes so long. I just
2010 Aug 16
3
Load dummy data using Factory girl
Hello, I wanted to know how to load dummy data in the application using Factory girl. I had done this using Fixtures.I had made a fixtures folder into the test folder and run the command "rake test fixtures:load" Currently i tried using factories in the spec which is working fine. Wanted to know know regarding loading dummy data. -- Posted via http://www.ruby-forum.com/.
2013 Feb 28
1
Validation Failed: Userkey has already been taken, Email has already been taken
Hi, I am using Factory girl with rspec and capybara for testing my rails appliction. I have the below code FactoryGirl.define do factory :user do |f| f.email "sss1 at gmail.com" f.userkey "12ssd345q62" end end When I run the test it is failing as "Validation Failed: Userkey has already been taken, Email has already been taken". What could be the reason for
2012 Dec 04
0
Empty test suite is run after every rake task
...dgreen'' gem ''diff-lcs'' gem ''cucumber-rails'' gem ''capybara'' gem ''database_cleaner'' gem ''rspec-rails'', ''2.7.0'' gem ''rspec_tag_matchers'' gem ''factory_girl'' gem ''spork'', ''~> 0.9.0.rc'' gem ''guard-rspec'' gem ''watchr'' group :darwin do gem ''rb-fsevent'', :require => false gem ''growl'', :require => false end en...
2012 Nov 19
6
puppet-dashboard - rake API not working
...g.gem: Unpacked gem haml-3.1.2 in vendor/gems has no specification file. Run ''rake gems:refresh_specs'' to fix this. config.gem: Unpacked gem sass-3.1.2 in vendor/gems has no specification file. Run ''rake gems:refresh_specs'' to fix this. config.gem: Unpacked gem factory_girl-1.3.3 in vendor/gems has no specification file. Run ''rake gems:refresh_specs'' to fix this. DEPRECATION WARNING: Rake tasks in vendor/plugins/delayed_job/tasks are deprecated. Use lib/tasks instead. (called from /usr/share/puppet-dashboard/vendor/rails/railties/lib/tasks/rails.r...
2010 Jan 29
4
requiring records in the DB before testing
Is there any way I can require a small set of data be in the test database before any tests are run? (unit, functional, integration, cucumber, etc) Any way besides using fixtures, that is. Overload a rake task? Modify test_helper? Any ideas? (Simple Case: I have to have a minimal set of user roles defined before any users can be created) -- You received this message because you are subscribed to
2010 Aug 08
2
issue with rescue_action_in_public! and testing 404 responses
...wever, this does not seem to do anything for me. The example still fails because the exception bubbles escapes unhandled from the controller. Do I need to set something up for the rescue_action_in_public! to work? Or is this not the correct way to test missing records? My full example: (using factory_girl, rspec mocks and devise) it "respons with 404 when trying to edit non-existing reads" do rescue_action_in_public! sign_in(@user) Read.should_receive(:find_by_id_and_user_id!).with(2, @user.id).and_raise(ActiveRecord::RecordNotFound) get :edit, :id => 2 response.statu...
2012 Mar 07
6
Can't find the PostgreSQL client library (libpq)
When i try it start my ruby server i get a error that looks like rails server Could not find pg-0.12.2 in any of the sources Run `bundle install` to install missing gems. I dont know what to do Thanks for all the help -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2010 Jul 08
3
my web app seed data and cucumber
I''m writing a web app which is used a SaS. Each customer has their own db and app directory. I have a rake task which creates all necessary minimum data to run their website: default rights and roles, a superadmin user, a "us_states" table already populated, some local depots and terminals (it''s a logistics app). I don''t have any cucumber scenarios for it and
2011 Jan 28
5
mysql quotation wonky
Why would, in an upgrade from 3.0.1 to 3.0.3, a rake db:migrate run this: SELECT "schema_migrations"."version" FROM "schema_migrations" vs this ? SELECT `schema_migrations`.`version` FROM `schema_migrations` __ rake db:migrate output __ rake aborted! Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
2013 Aug 22
1
How do I deal with ActiveRecord::RecordInvalid: Validation failed:
...alid: Validation failed: Reservation limit reached for this time slot test/models/reservation_test.rb:29:in `block (2 levels) in <class:ReservationTest>'' I was wondering if anyone can give me an ideas of how to deal with this. My test environment is using shoulda, faker, and factory_girl test/models/reservation_test.rb: setup do List.create(name: ''reservation_limit'', values: 20) @reservation = FactoryGirl.build(:reservation) end should "remove unavailable times if reservation limit for time slot is full" do 20.times{ Fa...
2011 Nov 02
3
form_for text_field
...ource (2.3.5) activesupport (3.1.1, 3.0.3, 2.3.8, 2.3.5) arel (2.0.6) builder (3.0.0, 2.1.2) calendar_date_select (1.16.1) cgi_multipart_eof_fix (2.5.0) columnize (0.3.2) composite_primary_keys (2.3.5.1) cucumber (0.7.2) cucumber-rails (0.3.1) diff-lcs (1.1.2) erubis (2.7.0, 2.6.6) ezcrypto (0.7.2) factory_girl (1.2.4) fastercsv (1.5.3) formtastic (0.9.8) gem_plugin (0.2.3) gherkin (2.3.2 x86-mingw32, 1.0.26 i386-mingw32) hike (1.2.1) i18n (0.6.0, 0.5.0) json (1.4.6) json_pure (1.4.6, 1.4.3) linecache (0.43) log4r (1.1.7) mongrel (1.1.5 x86-mingw32) multi_json (1.0.3) nokogiri (1.4.1 x86-mingw32) prawn (0...