rails_apps_testing 0.3.12 → 0.3.13

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 (21) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.textile +4 -0
  3. data/README.textile +6 -6
  4. data/lib/generators/testing/configure/configure_generator.rb +1 -1
  5. data/lib/generators/testing/configure/templates/application.rb +1 -1
  6. data/lib/generators/testing/configure/templates/factory_bot.rb +3 -0
  7. data/lib/generators/testing/configure/templates/spec/devise/factories/users.rb +1 -1
  8. data/lib/generators/testing/configure/templates/spec/devise/features/users/sign_in_spec.rb +3 -3
  9. data/lib/generators/testing/configure/templates/spec/devise/features/users/sign_out_spec.rb +1 -1
  10. data/lib/generators/testing/configure/templates/spec/devise/features/users/user_delete_spec.rb +1 -1
  11. data/lib/generators/testing/configure/templates/spec/devise/features/users/user_edit_spec.rb +3 -3
  12. data/lib/generators/testing/configure/templates/spec/devise/features/users/user_index_spec.rb +1 -1
  13. data/lib/generators/testing/configure/templates/spec/devise/features/users/user_show_spec.rb +3 -3
  14. data/lib/generators/testing/configure/templates/spec/omniauth/factories/users.rb +1 -1
  15. data/lib/generators/testing/configure/templates/spec/omniauth/models/user_spec.rb +1 -1
  16. data/lib/generators/testing/configure/templates/spec/pundit/factories/users.rb +1 -1
  17. data/lib/generators/testing/configure/templates/spec/pundit/features/users/user_index_spec.rb +1 -1
  18. data/lib/generators/testing/configure/templates/spec/pundit/policies/user_policy_spec.rb +3 -3
  19. data/lib/rails_apps_testing/version.rb +1 -1
  20. metadata +4 -4
  21. data/lib/generators/testing/configure/templates/factory_girl.rb +0 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1e477491457cecddeb2d61f315251dd763251e76
4
- data.tar.gz: 18cfec9838b68a9f44d5ef5591b7ac0179541173
2
+ SHA256:
3
+ metadata.gz: d603d8d040a943386f4c43e02bf36fc80bb21cdc024200cd01d7e051c94eee3c
4
+ data.tar.gz: acc8e5214358e716c8aba01810226aa93b52ce62636b5eeeaf90aeb8defa655f
5
5
  SHA512:
6
- metadata.gz: 254e8dce0945175ac49f6f081d9c41933ca46db6c8b7b4557c9a0d1158b0f6cf8ba9f21db15ee9c8c03abbe42969c290507d1a71be60320ba18780a3cf09428f
7
- data.tar.gz: 39fdd6fa1f5069130bd8b689fd02535b7a157a2bbda0ac409a88cc2384ec3e2a264fac3a16466597f6dcb3556a93c9b6d2770c0131e3a50b592fccc857454782
6
+ metadata.gz: ebb7cb0e8c312d4901b19987551122a895c06b63e04f5699a60caf8e7ff35be9a611eee07e4fb5d2140aa8c05f66484e569c2ef2c46ac319d78ddaa9df05b3eb
7
+ data.tar.gz: 2701f59719a5a5ed84d5888d3f2c586bd1d6b8b72e7584606cc4c0f7580eb1d004a83e015b6e6928851fabfee2499e49b2d7aacd485db0fecaf6f321798c7647
@@ -1,5 +1,9 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h3. 0.3.13 February 9, 2018
4
+
5
+ * FactoryGirl now named FactoryBot
6
+
3
7
  h3. 0.3.12 October 5, 2014
4
8
 
5
9
  * update for Devise 3.4 changed error messages
@@ -13,7 +13,7 @@ Use this gem to set up a testing framework. The gem modifies a Rails application
13
13
  * "RSpec Rails":https://github.com/rspec/rspec-rails – installs RSpec gems with support for Rails
14
14
  * "Capybara":https://github.com/jnicklas/capybara – tests web pages
15
15
  * "Database Cleaner":https://github.com/bmabey/database_cleaner – a clean slate for databases
16
- * "FactoryGirl Rails":https://github.com/thoughtbot/factory_girl_rails – creates test data
16
+ * "FactoryBot Rails":https://github.com/thoughtbot/factory_bot_rails – creates test data
17
17
  * "Launchy":https://github.com/copiousfreetime/launchy – view errors in your web browser
18
18
  * "Selenium Webdriver":http://docs.seleniumhq.org/projects/webdriver/ – for tests that require JavaScript
19
19
 
@@ -47,7 +47,7 @@ group :development do
47
47
  end
48
48
  group :development, :test do
49
49
  gem 'rspec-rails'
50
- gem 'factory_girl_rails'
50
+ gem 'factory_bot_rails'
51
51
  end
52
52
  group :test do
53
53
  gem 'capybara'
@@ -128,7 +128,7 @@ config.generators do |g|
128
128
  routing_specs: false,
129
129
  controller_specs: false,
130
130
  request_specs: false
131
- g.fixture_replacement :factory_girl, dir: "spec/factories"
131
+ g.fixture_replacement :factory_bot, dir: "spec/factories"
132
132
  end
133
133
  </pre>
134
134
 
@@ -174,13 +174,13 @@ It will also modify *spec/rails_helper.rb*:
174
174
  config.use_transactional_fixtures = false
175
175
  </pre>
176
176
 
177
- h3. FactoryGirl Configuration
177
+ h3. FactoryBot Configuration
178
178
 
179
- The generator will set up FactoryGirl shortcuts with a file *spec/support/factory_girl.rb*:
179
+ The generator will set up FactoryBot shortcuts with a file *spec/support/factory_bot.rb*:
180
180
 
181
181
  <pre>
182
182
  RSpec.configure do |config|
183
- config.include FactoryGirl::Syntax::Methods
183
+ config.include FactoryBot::Syntax::Methods
184
184
  end
185
185
  </pre>
186
186
 
@@ -24,7 +24,7 @@ module Testing
24
24
  gsub_file 'spec/rails_helper.rb', /config.use_transactional_fixtures = true/, "config.use_transactional_fixtures = false"
25
25
  gsub_file 'spec/rails_helper.rb', /# Dir/, "Dir"
26
26
  copy_file 'database_cleaner.rb', 'spec/support/database_cleaner.rb'
27
- copy_file 'factory_girl.rb', 'spec/support/factory_girl.rb'
27
+ copy_file 'factory_bot.rb', 'spec/support/factory_bot.rb'
28
28
  when 'devise'
29
29
  copy_file 'spec/devise/support/devise.rb', 'spec/support/devise.rb'
30
30
  copy_file 'spec/devise/support/helpers/session_helpers.rb', 'spec/support/helpers/session_helpers.rb'
@@ -7,5 +7,5 @@
7
7
  routing_specs: false,
8
8
  controller_specs: false,
9
9
  request_specs: false
10
- g.fixture_replacement :factory_girl, dir: "spec/factories"
10
+ g.fixture_replacement :factory_bot, dir: "spec/factories"
11
11
  end
@@ -0,0 +1,3 @@
1
+ RSpec.configure do |config|
2
+ config.include FactoryBot::Syntax::Methods
3
+ end
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :user do
3
3
  name "Test User"
4
4
  email "test@example.com"
@@ -19,7 +19,7 @@ feature 'Sign in', :devise do
19
19
  # When I sign in with valid credentials
20
20
  # Then I see a success message
21
21
  scenario 'user can sign in with valid credentials' do
22
- user = FactoryGirl.create(:user)
22
+ user = FactoryBot.create(:user)
23
23
  signin(user.email, user.password)
24
24
  expect(page).to have_content I18n.t 'devise.sessions.signed_in'
25
25
  end
@@ -30,7 +30,7 @@ feature 'Sign in', :devise do
30
30
  # When I sign in with a wrong email
31
31
  # Then I see an invalid email message
32
32
  scenario 'user cannot sign in with wrong email' do
33
- user = FactoryGirl.create(:user)
33
+ user = FactoryBot.create(:user)
34
34
  signin('invalid@email.com', user.password)
35
35
  expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'email'
36
36
  end
@@ -41,7 +41,7 @@ feature 'Sign in', :devise do
41
41
  # When I sign in with a wrong password
42
42
  # Then I see an invalid password message
43
43
  scenario 'user cannot sign in with wrong password' do
44
- user = FactoryGirl.create(:user)
44
+ user = FactoryBot.create(:user)
45
45
  signin(user.email, 'invalidpass')
46
46
  expect(page).to have_content I18n.t 'devise.failure.invalid', authentication_keys: 'email'
47
47
  end
@@ -9,7 +9,7 @@ feature 'Sign out', :devise do
9
9
  # When I sign out
10
10
  # Then I see a signed out message
11
11
  scenario 'user signs out successfully' do
12
- user = FactoryGirl.create(:user)
12
+ user = FactoryBot.create(:user)
13
13
  signin(user.email, user.password)
14
14
  expect(page).to have_content I18n.t 'devise.sessions.signed_in'
15
15
  click_link 'Sign out'
@@ -17,7 +17,7 @@ feature 'User delete', :devise, :js do
17
17
  # Then I should see an account deleted message
18
18
  scenario 'user can delete own account' do
19
19
  skip 'skip a slow test'
20
- user = FactoryGirl.create(:user)
20
+ user = FactoryBot.create(:user)
21
21
  login_as(user, :scope => :user)
22
22
  visit edit_user_registration_path(user)
23
23
  click_button 'Cancel my account'
@@ -16,7 +16,7 @@ feature 'User edit', :devise do
16
16
  # When I change my email address
17
17
  # Then I see an account updated message
18
18
  scenario 'user changes email address' do
19
- user = FactoryGirl.create(:user)
19
+ user = FactoryBot.create(:user)
20
20
  login_as(user, :scope => :user)
21
21
  visit edit_user_registration_path(user)
22
22
  fill_in 'Email', :with => 'newemail@example.com'
@@ -31,8 +31,8 @@ feature 'User edit', :devise do
31
31
  # When I try to edit another user's profile
32
32
  # Then I see my own 'edit profile' page
33
33
  scenario "user cannot cannot edit another user's profile", :me do
34
- me = FactoryGirl.create(:user)
35
- other = FactoryGirl.create(:user, email: 'other@example.com')
34
+ me = FactoryBot.create(:user)
35
+ other = FactoryBot.create(:user, email: 'other@example.com')
36
36
  login_as(me, :scope => :user)
37
37
  visit edit_user_registration_path(other)
38
38
  expect(page).to have_content 'Edit User'
@@ -16,7 +16,7 @@ feature 'User index page', :devise do
16
16
  # When I visit the user index page
17
17
  # Then I see my own email address
18
18
  scenario 'user sees own email address' do
19
- user = FactoryGirl.create(:user)
19
+ user = FactoryBot.create(:user)
20
20
  login_as(user, scope: :user)
21
21
  visit users_path
22
22
  expect(page).to have_content user.email
@@ -16,7 +16,7 @@ feature 'User profile page', :devise do
16
16
  # When I visit the user profile page
17
17
  # Then I see my own email address
18
18
  scenario 'user sees own profile' do
19
- user = FactoryGirl.create(:user)
19
+ user = FactoryBot.create(:user)
20
20
  login_as(user, :scope => :user)
21
21
  visit user_path(user)
22
22
  expect(page).to have_content 'User'
@@ -28,8 +28,8 @@ feature 'User profile page', :devise do
28
28
  # When I visit another user's profile
29
29
  # Then I see an 'access denied' message
30
30
  scenario "user cannot see another user's profile" do
31
- me = FactoryGirl.create(:user)
32
- other = FactoryGirl.create(:user, email: 'other@example.com')
31
+ me = FactoryBot.create(:user)
32
+ other = FactoryBot.create(:user, email: 'other@example.com')
33
33
  login_as(me, :scope => :user)
34
34
  Capybara.current_session.driver.header 'Referer', root_path
35
35
  visit user_path(other)
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :user do
3
3
  name "Test User"
4
4
  end
@@ -1,6 +1,6 @@
1
1
  describe User do
2
2
 
3
- before(:each) { @user = FactoryGirl.create(:user) }
3
+ before(:each) { @user = FactoryBot.create(:user) }
4
4
 
5
5
  subject { @user }
6
6
 
@@ -1,4 +1,4 @@
1
- FactoryGirl.define do
1
+ FactoryBot.define do
2
2
  factory :user do
3
3
  name "Test User"
4
4
  email "test@example.com"
@@ -16,7 +16,7 @@ feature 'User index page', :devise do
16
16
  # When I visit the user index page
17
17
  # Then I see my own email address
18
18
  scenario 'user sees own email address' do
19
- user = FactoryGirl.create(:user, :admin)
19
+ user = FactoryBot.create(:user, :admin)
20
20
  login_as(user, scope: :user)
21
21
  visit users_path
22
22
  expect(page).to have_content user.email
@@ -1,9 +1,9 @@
1
1
  describe UserPolicy do
2
2
  subject { UserPolicy }
3
3
 
4
- let (:current_user) { FactoryGirl.build_stubbed :user }
5
- let (:other_user) { FactoryGirl.build_stubbed :user }
6
- let (:admin) { FactoryGirl.build_stubbed :user, :admin }
4
+ let (:current_user) { FactoryBot.build_stubbed :user }
5
+ let (:other_user) { FactoryBot.build_stubbed :user }
6
+ let (:admin) { FactoryBot.build_stubbed :user, :admin }
7
7
 
8
8
  permissions :index? do
9
9
  it "denies access if not an admin" do
@@ -1,3 +1,3 @@
1
1
  module RailsAppsTesting
2
- VERSION = "0.3.12"
2
+ VERSION = "0.3.13"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_apps_testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Kehoe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-05 00:00:00.000000000 Z
11
+ date: 2018-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -57,7 +57,7 @@ files:
57
57
  - lib/generators/testing/configure/templates/application.rb
58
58
  - lib/generators/testing/configure/templates/capybara.rb
59
59
  - lib/generators/testing/configure/templates/database_cleaner.rb
60
- - lib/generators/testing/configure/templates/factory_girl.rb
60
+ - lib/generators/testing/configure/templates/factory_bot.rb
61
61
  - lib/generators/testing/configure/templates/spec/devise/factories/users.rb
62
62
  - lib/generators/testing/configure/templates/spec/devise/features/users/sign_in_spec.rb
63
63
  - lib/generators/testing/configure/templates/spec/devise/features/users/sign_out_spec.rb
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.2.2
107
+ rubygems_version: 2.7.4
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Sets up a testing framework for a Rails application.
@@ -1,3 +0,0 @@
1
- RSpec.configure do |config|
2
- config.include FactoryGirl::Syntax::Methods
3
- end