diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-07-16 13:01:34 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-07-16 13:13:06 +0200 |
commit | b08d41fcf32e33f32d131863349765d8fe80e043 (patch) | |
tree | 15e9913362c2983734bd0bcef5bcc26471e1ac77 | |
parent | Seed database for demos (diff) | |
download | council-webapp-b08d41fcf32e33f32d131863349765d8fe80e043.tar.gz council-webapp-b08d41fcf32e33f32d131863349765d8fe80e043.tar.bz2 council-webapp-b08d41fcf32e33f32d131863349765d8fe80e043.zip |
Use factory_girl_rails, don't require factories manually
-rw-r--r-- | site/Gemfile | 2 | ||||
-rw-r--r-- | site/Gemfile.lock | 5 | ||||
-rw-r--r-- | site/db/seeds.rb | 3 | ||||
-rw-r--r-- | site/features/support/factories.rb | 2 | ||||
-rw-r--r-- | site/spec/factories.rb | 2 | ||||
-rw-r--r-- | site/spec/spec_helper.rb | 1 |
6 files changed, 7 insertions, 8 deletions
diff --git a/site/Gemfile b/site/Gemfile index bba1887..67dc50a 100644 --- a/site/Gemfile +++ b/site/Gemfile @@ -18,7 +18,7 @@ group :development, :test do gem 'database_cleaner' gem 'launchy' gem 'show_me_the_cookies' - gem 'factory_girl' + gem 'factory_girl_rails' gem 'fuubar-cucumber' end diff --git a/site/Gemfile.lock b/site/Gemfile.lock index 5127cbf..d2a4c5a 100644 --- a/site/Gemfile.lock +++ b/site/Gemfile.lock @@ -94,6 +94,9 @@ GEM erubis (2.6.6) abstract (>= 1.0.0) factory_girl (1.3.3) + factory_girl_rails (1.0.1) + factory_girl (~> 1.3) + railties (>= 3.0.0) faraday (0.6.1) addressable (~> 2.2.4) multipart-post (~> 1.1.0) @@ -222,7 +225,7 @@ DEPENDENCIES delayed_job devise email_spec - factory_girl + factory_girl_rails fuubar-cucumber hobo (>= 1.3.0.pre28)! hobo_devise (>= 0.0.2) diff --git a/site/db/seeds.rb b/site/db/seeds.rb index f276aa6..40e1a11 100644 --- a/site/db/seeds.rb +++ b/site/db/seeds.rb @@ -1,6 +1,3 @@ -require File.expand_path("../../spec/factories.rb", __FILE__) -require File.expand_path("../../spec/support/users_factory.rb", __FILE__) - def vote(user, item, option_description) option = VotingOption.agenda_item_is(item).description_is(option_description).first Factory(:vote, :voting_option => option, :user => user, :council_vote => true) diff --git a/site/features/support/factories.rb b/site/features/support/factories.rb deleted file mode 100644 index 300fee7..0000000 --- a/site/features/support/factories.rb +++ /dev/null @@ -1,2 +0,0 @@ -require File.expand_path("../../../spec/factories.rb", __FILE__) -require File.expand_path("../../../spec/support/users_factory.rb", __FILE__) diff --git a/site/spec/factories.rb b/site/spec/factories.rb index dbf841e..01a69f7 100644 --- a/site/spec/factories.rb +++ b/site/spec/factories.rb @@ -31,3 +31,5 @@ Factory.define :proxy do |p|; p.proxy {users_factory(:user)} p.agenda {Factory(:agenda)} end + +require File.expand_path("../support/users_factory.rb", __FILE__) diff --git a/site/spec/spec_helper.rb b/site/spec/spec_helper.rb index 770b158..c13e1c5 100644 --- a/site/spec/spec_helper.rb +++ b/site/spec/spec_helper.rb @@ -1,7 +1,6 @@ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' -require 'factories.rb' environment_path = File.expand_path(File.join(::Rails.root.to_s, 'config', 'environment')) require(environment_path) |