pacecar 1.5.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.travis.yml +9 -1
  4. data/Appraisals +9 -17
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +93 -108
  7. data/MIT-LICENSE +1 -1
  8. data/README.md +10 -109
  9. data/Rakefile +9 -5
  10. data/TESTING.md +40 -0
  11. data/gemfiles/rails_4_mysql2_driver.gemfile +8 -0
  12. data/gemfiles/rails_4_pg_driver.gemfile +8 -0
  13. data/gemfiles/rails_4_sqlite3_driver.gemfile +8 -0
  14. data/lib/pacecar.rb +0 -10
  15. data/lib/pacecar/boolean.rb +8 -20
  16. data/lib/pacecar/helpers.rb +7 -16
  17. data/lib/pacecar/limit.rb +9 -9
  18. data/lib/pacecar/order.rb +9 -9
  19. data/lib/pacecar/polymorph.rb +5 -5
  20. data/lib/pacecar/presence.rb +8 -9
  21. data/lib/pacecar/search.rb +8 -32
  22. data/lib/pacecar/state.rb +13 -9
  23. data/lib/pacecar/version.rb +1 -1
  24. data/pacecar.gemspec +18 -16
  25. data/spec/boolean_spec.rb +6 -18
  26. data/spec/dummy/app/models/mammal.rb +1 -1
  27. data/spec/dummy/app/models/post.rb +2 -2
  28. data/spec/dummy/app/models/user.rb +1 -6
  29. data/spec/dummy/bin/bundle +3 -0
  30. data/spec/dummy/bin/rails +4 -0
  31. data/spec/dummy/bin/rake +4 -0
  32. data/spec/dummy/config/application.rb +4 -26
  33. data/spec/dummy/config/boot.rb +3 -9
  34. data/spec/dummy/config/database.yml +1 -7
  35. data/spec/dummy/config/environment.rb +2 -2
  36. data/spec/dummy/config/environments/development.rb +15 -12
  37. data/spec/dummy/config/environments/production.rb +57 -26
  38. data/spec/dummy/config/environments/test.rb +16 -15
  39. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/spec/dummy/config/initializers/inflections.rb +9 -3
  41. data/spec/dummy/config/initializers/secret_token.rb +7 -2
  42. data/spec/dummy/config/initializers/session_store.rb +1 -6
  43. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  44. data/spec/dummy/config/locales/en.yml +20 -2
  45. data/spec/dummy/config/routes.rb +22 -24
  46. data/spec/factories.rb +2 -2
  47. data/spec/helpers_spec.rb +18 -26
  48. data/spec/integration/navigation_spec.rb +4 -5
  49. data/spec/limit_spec.rb +11 -11
  50. data/spec/order_spec.rb +8 -8
  51. data/spec/pacecar_spec.rb +3 -3
  52. data/spec/polymorph_spec.rb +6 -6
  53. data/spec/presence_spec.rb +9 -9
  54. data/spec/search_spec.rb +14 -48
  55. data/spec/spec_helper.rb +11 -17
  56. data/spec/state_spec.rb +29 -29
  57. metadata +76 -70
  58. data/gemfiles/rails-3.0.11-database-mysql.gemfile +0 -8
  59. data/gemfiles/rails-3.0.11-database-mysql.gemfile.lock +0 -134
  60. data/gemfiles/rails-3.0.11-database-mysql2.gemfile +0 -8
  61. data/gemfiles/rails-3.0.11-database-mysql2.gemfile.lock +0 -134
  62. data/gemfiles/rails-3.0.11-database-pg.gemfile +0 -8
  63. data/gemfiles/rails-3.0.11-database-pg.gemfile.lock +0 -134
  64. data/gemfiles/rails-3.0.11-database-sqlite3-ruby.gemfile +0 -8
  65. data/gemfiles/rails-3.0.11-database-sqlite3-ruby.gemfile.lock +0 -136
  66. data/gemfiles/rails-3.0.11-database-sqlite3.gemfile +0 -8
  67. data/gemfiles/rails-3.0.11-database-sqlite3.gemfile.lock +0 -134
  68. data/gemfiles/rails-3.1.3-database-mysql.gemfile +0 -8
  69. data/gemfiles/rails-3.1.3-database-mysql.gemfile.lock +0 -144
  70. data/gemfiles/rails-3.1.3-database-mysql2.gemfile +0 -8
  71. data/gemfiles/rails-3.1.3-database-mysql2.gemfile.lock +0 -144
  72. data/gemfiles/rails-3.1.3-database-pg.gemfile +0 -8
  73. data/gemfiles/rails-3.1.3-database-pg.gemfile.lock +0 -144
  74. data/gemfiles/rails-3.1.3-database-sqlite3-ruby.gemfile +0 -8
  75. data/gemfiles/rails-3.1.3-database-sqlite3-ruby.gemfile.lock +0 -146
  76. data/gemfiles/rails-3.1.3-database-sqlite3.gemfile +0 -8
  77. data/gemfiles/rails-3.1.3-database-sqlite3.gemfile.lock +0 -144
  78. data/lib/pacecar/associations.rb +0 -39
  79. data/lib/pacecar/datetime.rb +0 -91
  80. data/lib/pacecar/duration.rb +0 -51
  81. data/lib/pacecar/numeric.rb +0 -29
  82. data/lib/pacecar/ranking.rb +0 -53
  83. data/spec/associations_spec.rb +0 -32
  84. data/spec/datetime_spec.rb +0 -92
  85. data/spec/duration_spec.rb +0 -22
  86. data/spec/numeric_spec.rb +0 -43
  87. data/spec/ranking_spec.rb +0 -63
@@ -1,5 +1,23 @@
1
- # Sample localization file for English. Add more files in this directory for other locales.
2
- # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
3
21
 
4
22
  en:
5
23
  hello: "Hello world"
@@ -1,19 +1,20 @@
1
1
  Dummy::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
4
 
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
8
10
 
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
12
13
 
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
14
15
  # resources :products
15
16
 
16
- # Sample resource route with options:
17
+ # Example resource route with options:
17
18
  # resources :products do
18
19
  # member do
19
20
  # get 'short'
@@ -25,34 +26,31 @@ Dummy::Application.routes.draw do
25
26
  # end
26
27
  # end
27
28
 
28
- # Sample resource route with sub-resources:
29
+ # Example resource route with sub-resources:
29
30
  # resources :products do
30
31
  # resources :comments, :sales
31
32
  # resource :seller
32
33
  # end
33
34
 
34
- # Sample resource route with more complex sub-resources
35
+ # Example resource route with more complex sub-resources:
35
36
  # resources :products do
36
37
  # resources :comments
37
38
  # resources :sales do
38
- # get 'recent', :on => :collection
39
+ # get 'recent', on: :collection
39
40
  # end
40
41
  # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
41
49
 
42
- # Sample resource route within a namespace:
50
+ # Example resource route within a namespace:
43
51
  # namespace :admin do
44
52
  # # Directs /admin/products/* to Admin::ProductsController
45
53
  # # (app/controllers/admin/products_controller.rb)
46
54
  # resources :products
47
55
  # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => "welcome#index"
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- # match ':controller(/:action(/:id(.:format)))'
58
56
  end
@@ -19,8 +19,8 @@ FactoryGirl.define do
19
19
  end
20
20
 
21
21
  factory :user do
22
- age { Factory.next :age }
23
- rating { Factory.next :rating }
22
+ age
23
+ rating
24
24
  end
25
25
 
26
26
  end
@@ -2,47 +2,39 @@ require 'spec_helper'
2
2
 
3
3
  describe 'Helpers' do
4
4
 
5
- describe "A class without a db table" do
6
- it "should return an empty array when asked about #safe_columns" do
7
- Article.send(:safe_columns).should == []
5
+ describe 'A class without a db table' do
6
+ it 'Returns an empty array when asked about #safe_columns' do
7
+ expect(Article.send(:safe_columns)).to eq []
8
8
  end
9
9
 
10
- it "should survive an include of Pacecar" do
11
- lambda { Article.send :include, Pacecar }.should_not raise_error
10
+ it 'Survives an include of Pacecar' do
11
+ expect { Article.send :include, Pacecar }.to_not raise_error
12
12
  end
13
13
  end
14
14
 
15
- describe "A class with a db table" do
16
- it "should should return columns for #safe_column_names" do
17
- Comment.safe_column_names.should == ['id', 'user_id', 'description', 'rating', 'created_at', 'updated_at']
15
+ describe 'A class with a db table' do
16
+ it 'Returns columns for #safe_column_names' do
17
+ expect(Comment.safe_column_names).to eq ['id', 'user_id', 'description', 'rating', 'created_at', 'updated_at']
18
18
  end
19
19
  end
20
20
 
21
- describe "A class with many column types" do
22
- it "should return boolean columns for #boolean_column_names" do
23
- User.boolean_column_names.should == ['admin']
21
+ describe 'A class with many column types' do
22
+ it 'Returns boolean columns for #boolean_column_names' do
23
+ expect(User.boolean_column_names).to eq ['admin']
24
24
  end
25
25
 
26
- it "should return non boolean columns for #non_boolean_column_names" do
27
- User.non_boolean_column_names.should == ['id', 'approved_at', 'rejected_at', 'last_posted_on', 'first_name', 'last_name', 'description', 'age', 'rating', 'balance', 'created_at', 'updated_at']
26
+ it 'Returns non boolean columns for #non_boolean_column_names' do
27
+ expect(User.non_boolean_column_names).to eq ['id', 'approved_at', 'rejected_at', 'last_posted_on', 'first_name', 'last_name', 'description', 'age', 'rating', 'balance', 'created_at', 'updated_at']
28
28
  end
29
29
 
30
- it "should return datetime columns for #datetime_column_names" do
31
- User.datetime_column_names.should == ['approved_at', 'rejected_at', 'last_posted_on', 'created_at', 'updated_at']
32
- end
33
-
34
- it "should return text and string columns for #text_and_string_column_names" do
35
- User.text_and_string_column_names.should == ['first_name', 'last_name', 'description']
36
- end
37
-
38
- it "should return numeric columns for #numeric_column_names" do
39
- User.numeric_column_names.should == ['id', 'age', 'rating', 'balance']
30
+ it 'Returns text and string columns for #text_and_string_column_names' do
31
+ expect(User.text_and_string_column_names).to eq ['first_name', 'last_name', 'description']
40
32
  end
41
33
  end
42
34
 
43
- describe "A class with a state column should" do
44
- it "should return all non state text and string columns for #non_state_text_and_string_column_names" do
45
- Post.non_state_text_and_string_columns.should == ['title', 'body']
35
+ describe 'A class with a state column should' do
36
+ it 'Returns all non state text and string columns for #non_state_text_and_string_column_names' do
37
+ expect(Post.non_state_text_and_string_columns).to eq ['title', 'body']
46
38
  end
47
39
  end
48
40
 
@@ -1,9 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "Navigation" do
4
- include Capybara::DSL
5
-
6
- it "should be a valid app" do
7
- ::Rails.application.should be_a(Dummy::Application)
3
+ describe 'Navigation' do
4
+
5
+ it 'should be a valid app' do
6
+ expect(::Rails.application).to be_a(Dummy::Application)
8
7
  end
9
8
  end
@@ -3,23 +3,23 @@ require 'spec_helper'
3
3
  describe 'Limit' do
4
4
 
5
5
  before do
6
- 50.times { Factory :user }
6
+ create_list(:user, 15)
7
7
  end
8
8
 
9
- it "should set the correct expected values for a by_ column method" do
10
- User.count.should == 50
11
- User.limited.all.size.should == 10
9
+ it 'Limits the results to the default value' do
10
+ expect(User.count).to eq 15
11
+ expect(User.limited.size).to eq 10
12
12
  end
13
13
 
14
- it "should set the correct expected values for a by_ column method when sent args" do
15
- User.count.should == 50
16
- User.limited(20).all.size.should == 20
14
+ it 'Limits the results to the supplied value when sent args' do
15
+ expect(User.count).to eq 15
16
+ expect(User.limited(5).size).to eq 5
17
17
  end
18
18
 
19
- it "should set the correct expected values for a by_ column method when per_page defined" do
20
- User.expects(:per_page).returns 30
21
- User.count.should == 50
22
- User.limited.all.size.should == 30
19
+ it 'Limits the results to the per_page value of the class' do
20
+ User.expects(:per_page).returns 2
21
+ expect(User.count).to eq 15
22
+ expect(User.limited.size).to eq 2
23
23
  end
24
24
 
25
25
  end
@@ -3,20 +3,20 @@ require 'spec_helper'
3
3
  describe 'Order' do
4
4
 
5
5
  before do
6
- @first = Factory :user, :first_name => 'Abe'
7
- @last = Factory :user, :first_name => 'Zed'
6
+ @first = create :user, first_name: 'Abe'
7
+ @last = create :user, first_name: 'Zed'
8
8
  end
9
9
 
10
- it "should set the correct expected values for a by_ column method with no args" do
11
- User.by_first_name.should == [@first, @last]
10
+ it 'Returns the correct results for a by_ column method with no args' do
11
+ expect(User.by_first_name).to eq [@first, @last]
12
12
  end
13
13
 
14
- it "should set the correct expected values for a by_ column method with asc args" do
15
- User.by_first_name(:asc).should == [@first, @last]
14
+ it 'Returns the correct results for a by_ column method with asc args' do
15
+ expect(User.by_first_name(:asc)).to eq [@first, @last]
16
16
  end
17
17
 
18
- it "should set the correct expected values for a by_ column method with desc args" do
19
- User.by_first_name(:desc).should == [@last, @first]
18
+ it 'Returns the correct results for a by_ column method with desc args' do
19
+ expect(User.by_first_name(:desc)).to eq [@last, @first]
20
20
  end
21
21
 
22
22
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Pacecar do
4
- it "should be valid" do
5
- Pacecar.should be_a(Module)
4
+ it 'Is a valid module' do
5
+ expect(Pacecar).to be_a(Module)
6
6
  end
7
- end
7
+ end
@@ -3,16 +3,16 @@ require 'spec_helper'
3
3
  describe 'Polymorph' do
4
4
 
5
5
  before do
6
- @owned_by_user = Factory :post, :owner_type => 'User'
7
- @owned_by_mammal = Factory :post, :owner_type => 'Mammal'
6
+ @owned_by_user = create :post, owner_type: 'User'
7
+ @owned_by_mammal = create :post, owner_type: 'Mammal'
8
8
  end
9
9
 
10
- it "should set the correct expected values on a _for column method with Class" do
11
- Post.for_owner_type(User).should == [@owned_by_user]
10
+ it 'Returns records on a _for column method with Class' do
11
+ expect(Post.for_owner_type(User)).to eq [@owned_by_user]
12
12
  end
13
13
 
14
- it "should set the correct expected values on a _for column method with String" do
15
- Post.for_owner_type('User').should == [@owned_by_user]
14
+ it 'Returns records on a _for column method with String' do
15
+ expect(Post.for_owner_type('User')).to eq [@owned_by_user]
16
16
  end
17
17
 
18
18
  end
@@ -3,21 +3,21 @@ require 'spec_helper'
3
3
  describe 'Presence' do
4
4
 
5
5
  before do
6
- @not_null = Factory :user, :first_name => 'Fake'
7
- @null = Factory :user, :first_name => nil
6
+ @not_null = create :user, first_name: 'Fake'
7
+ @null = create :user, first_name: nil
8
8
  end
9
9
 
10
- it "should set the correct expected values for a _present column method" do
11
- User.first_name_present.should == [@not_null]
10
+ it 'Returns records for a _present column method' do
11
+ expect(User.first_name_present).to eq [@not_null]
12
12
  end
13
13
 
14
- it "should set the correct expected values for a _missing column method" do
15
- User.first_name_missing.should == [@null]
14
+ it 'Returns records for a _missing column method' do
15
+ expect(User.first_name_missing).to eq [@null]
16
16
  end
17
17
 
18
- it "should not setup methods for boolean columns" do
19
- lambda { User.admin_missing }.should raise_error(NoMethodError)
20
- lambda { User.admin_present }.should raise_error(NoMethodError)
18
+ it 'Does not setup methods for boolean columns' do
19
+ expect { User.admin_missing }.to raise_error(NoMethodError)
20
+ expect { User.admin_present }.to raise_error(NoMethodError)
21
21
  end
22
22
 
23
23
  end
@@ -3,61 +3,27 @@ require 'spec_helper'
3
3
  describe 'Search' do
4
4
 
5
5
  before do
6
- @abe = Factory :user, :first_name => 'Abe', :last_name => 'Anderson', :description => 'Apple'
7
- @bob = Factory :user, :first_name => 'Bob', :last_name => 'Babson', :description => 'Banana'
8
- @cindy = Factory :user, :first_name => 'Cindy', :last_name => 'Clarkson', :description => 'Cookie'
9
- @dave = Factory :user, :first_name => 'Dave'
10
- @ed = Factory :user, :last_name => 'Dave'
11
- @frank = Factory :user, :description => 'Dave'
12
- @george = Factory :user, :first_name => 'Dave', :last_name => 'Dave', :description => 'Dave'
6
+ @abe = create :user, first_name: 'Abe', last_name: 'Anderson', description: 'Apple'
7
+ @bob = create :user, first_name: 'Bob', last_name: 'Babson', description: 'Banana'
8
+ @cindy = create :user, first_name: 'Cindy', last_name: 'Clarkson', description: 'Cookie'
9
+ @dave = create :user, first_name: 'Dave'
10
+ @ed = create :user, last_name: 'Dave'
11
+ @frank = create :user, description: 'Dave'
12
+ @george = create :user, first_name: 'Dave', last_name: 'Dave', description: 'Dave'
13
13
 
14
- @null = Factory :user, :first_name => nil, :last_name => nil, :description => nil
14
+ @null = create :user, first_name: nil, last_name: nil, description: nil
15
15
  end
16
16
 
17
- it "should set the correct expected values for a _equals column method" do
18
- User.first_name_equals('Abe').should == [@abe]
17
+ it 'Returns records which match the supplied term' do
18
+ expect(User.first_name_equals('Abe')).to eq [@abe]
19
19
  end
20
20
 
21
- it "should set the correct expected values for a _equals column method with an Array as value" do
22
- User.first_name_equals(['Abe', 'Bob']).should == [@abe, @bob]
21
+ it 'Returns records which match any of the supplied terms' do
22
+ expect(User.first_name_equals(['Abe', 'Bob'])).to eq [@abe, @bob]
23
23
  end
24
24
 
25
- it "should set the correct expected values for a _equals column method with nil as value" do
26
- User.first_name_equals(nil).should == [@ed, @frank, @null]
27
- end
28
-
29
- it "should set the correct expected values for a _matches column method" do
30
- User.first_name_matches('ind').should == [@cindy]
31
- User.first_name_matches('IND').should == [@cindy]
32
- end
33
-
34
- it "should set the correct expected values for a _starts_with column method" do
35
- User.first_name_starts_with('Ab').should == [@abe]
36
- User.first_name_starts_with('aB').should == [@abe]
37
- end
38
-
39
- it "should set the correct expected values for a _ends_with column method" do
40
- User.first_name_ends_with('ob').should == [@bob]
41
- User.first_name_ends_with('Ob').should == [@bob]
42
- end
43
-
44
- it "should set the correct expected values for a search_for method" do
45
- User.search_for('Dave').should == [@dave, @ed, @frank, @george]
46
- User.search_for('dave').should == [@dave, @ed, @frank, @george]
47
- end
48
-
49
- it "should set the correct expected values for a search_for method with :on option" do
50
- User.search_for('Dave', :on => [:first_name, :description]).should == [@dave, @frank, @george]
51
- User.search_for('dave', :on => [:first_name, :description]).should == [@dave, @frank, @george]
52
- end
53
-
54
- it "should set the correct expected values for a search_for method with an :require option" do
55
- User.search_for('Dave', :require => :all).should == [@george]
56
- User.search_for('dave', :require => :all).should == [@george]
57
- end
58
-
59
- it "should set the correct expected values for a search_for method on a class with no columns" do
60
- Mammal.search_for('test').should == []
25
+ it 'Returns records which match the supplied term when the term is nil' do
26
+ expect(User.first_name_equals(nil)).to eq [@ed, @frank, @null]
61
27
  end
62
28
 
63
29
  end
@@ -1,27 +1,22 @@
1
1
  # Configure Rails Envinronment
2
- ENV["RAILS_ENV"] = "test"
2
+ ENV['RAILS_ENV'] = 'test'
3
3
 
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
- require "rspec/rails"
4
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
5
+ require 'rails/test_help'
6
+ require 'rspec/rails'
7
7
 
8
8
  ActionMailer::Base.delivery_method = :test
9
9
  ActionMailer::Base.perform_deliveries = true
10
- ActionMailer::Base.default_url_options[:host] = "test.com"
10
+ ActionMailer::Base.default_url_options[:host] = 'test.com'
11
11
 
12
12
  Rails.backtrace_cleaner.remove_silencers!
13
13
 
14
- # Configure capybara for integration testing
15
- require "capybara/rails"
16
- Capybara.default_driver = :rack_test
17
- Capybara.default_selector = :css
18
-
19
- # Run any available migration
20
- ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
21
-
22
14
  # Load support files
23
15
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
24
16
 
17
+ require 'factory_girl'
18
+ require 'factories'
19
+
25
20
  RSpec.configure do |config|
26
21
  # Remove this line if you don't want RSpec's should and should_not
27
22
  # methods or matchers
@@ -29,10 +24,9 @@ RSpec.configure do |config|
29
24
  config.include RSpec::Matchers
30
25
 
31
26
  # == Mock Framework
32
- config.mock_with :mocha
27
+ config.mock_framework = :mocha
33
28
 
34
29
  config.use_transactional_fixtures = true
35
- end
36
30
 
37
- require 'factory_girl'
38
- require 'factories'
31
+ config.include FactoryGirl::Syntax::Methods
32
+ end