1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot_rails.git synced 2022-11-09 11:49:18 -05:00

Update rails versions on Travis (#367)

This commit gets the Travis build passing by:

- Removing Rails 4.2 so we don't have to deal with bundler < 2 anymore
- Bumping to latest Rails versions
- Explicitly listing all gems that appear in the default Rails Gemfile
- Avoiding bootsnap and javascript, since they aren't relevant to these tests

Co-authored-by: alex <alexandr1golubenko@gmail.com>
This commit is contained in:
Daniel Colson 2020-03-29 11:51:41 -04:00 committed by GitHub
parent 39ada50d89
commit 5c52981fcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 165 additions and 241 deletions

View file

@ -1,9 +1,6 @@
language: ruby
env:
- ARUBA_TIMEOUT=240
before_install:
- gem update --system
- rvm @default,@global do gem uninstall bundler -v 2.0.2 -x
cache: bundler
rvm:
- 2.3
@ -17,7 +14,6 @@ branches:
install:
- "bundle install --retry 3 --jobs 8"
gemfile:
- gemfiles/rails4.2.gemfile
- gemfiles/rails5.0.gemfile
- gemfiles/rails5.1.gemfile
- gemfiles/rails5.2.gemfile

View file

@ -1,47 +1,61 @@
# These are the versions of Rails we want to test against.
appraise "rails4.2" do
gem "rails", "~> 4.2.11"
gem "sqlite3", "~> 1.3.6"
end
appraise "rails5.0" do
gem "activerecord", "~> 5.0.7"
gem "railties", "~> 5.0.7"
gem "sqlite3", "~> 1.3.6"
gem "actionmailer", "~> 5.0.7"
gem "sass-rails"
gem "byebug"
gem "jbuilder", "~> 2.5"
gem "listen", "~> 3.0.5"
gem "puma", "~> 3.0"
gem "rails", "~> 5.0.7", ">= 5.0.7.2"
gem "sass-rails", "~> 5.0"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "uglifier", ">= 1.3.0"
gem "web-console", ">= 3.3.0", group: :development
end
appraise "rails5.1" do
gem "activerecord", "~> 5.1.7"
gem "railties", "~> 5.1.7"
gem "actionmailer", "~> 5.1.7"
gem "sass-rails"
gem "byebug"
gem "capybara", ">= 2.15"
gem "jbuilder", "~> 2.5"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 3.7"
gem "rails", "~> 5.1.7"
gem "sass-rails", "~> 5.0"
gem "selenium-webdriver"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.3.6"
gem "web-console", ">= 3.3.0", group: :development
end
appraise "rails5.2" do
gem "activerecord", "~> 5.2.3"
gem "railties", "~> 5.2.3"
gem "actionmailer", "~> 5.2.3"
gem "bootsnap"
gem "activestorage", "~> 5.2.3"
gem "sass-rails"
gem "byebug"
gem "capybara", ">= 2.15"
gem "chromedriver-helper"
gem "jbuilder", "~> 2.5"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 3.11"
gem "rails", "~> 5.2.4", ">= 5.2.4.2"
gem "sass-rails", "~> 5.0"
gem "selenium-webdriver"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.3.6"
gem "web-console", ">= 3.3.0", group: :development
end
appraise "rails6.0" do
gem "rails", "~> 6.0.0"
gem "bootsnap"
gem "byebug"
gem "capybara"
gem "jbuilder"
gem "listen", "~> 3.1.5"
gem "puma", "~> 3.11"
gem "sass-rails", "~> 5"
gem "capybara", ">= 2.15"
gem "jbuilder", "~> 2.7"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 4.1"
gem "rails", "~> 6.0.2", ">= 6.0.2.2"
gem "sass-rails", ">= 6"
gem "selenium-webdriver"
gem "spring"
gem "spring-watcher-listen"
gem "turbolinks"
gem "web-console", group: :development
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.4"
gem "web-console", ">= 3.3.0", group: :development
gem "webdrivers"
gem "webpacker"
end

11
Gemfile
View file

@ -4,19 +4,8 @@ gemspec name: "factory_bot_rails"
gem "appraisal"
gem "aruba"
gem "coffee-rails"
gem "cucumber", "1.3.19"
gem "jquery-rails"
gem "rake"
gem "rspec-rails"
gem "test-unit"
gem "uglifier"
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
gem "jdbc-sqlite3", platforms: :jruby
gem "jruby-openssl", platforms: :jruby
gem "therubyrhino", platforms: :jruby
gem "sqlite3", platforms: :ruby
gem "rubocop", "0.54", require: false

View file

@ -8,60 +8,42 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionpack (5.2.3)
actionview (= 5.2.3)
activesupport (= 5.2.3)
rack (~> 2.0)
actionpack (6.0.2.2)
actionview (= 6.0.2.2)
activesupport (= 6.0.2.2)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.3)
activesupport (= 5.2.3)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (6.0.2.2)
activesupport (= 6.0.2.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activemodel (5.2.3)
activesupport (= 5.2.3)
activerecord (5.2.3)
activemodel (= 5.2.3)
activesupport (= 5.2.3)
arel (>= 9.0)
activerecord-jdbc-adapter (52.3-java)
activerecord (~> 5.2.0)
activerecord-jdbcsqlite3-adapter (52.3-java)
activerecord-jdbc-adapter (= 52.3)
jdbc-sqlite3 (~> 3.8, < 3.30)
activesupport (5.2.3)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (6.0.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2)
appraisal (2.2.0)
bundler
rake
thor (>= 0.14.0)
arel (9.0.0)
aruba (0.14.12)
aruba (0.14.14)
childprocess (>= 0.6.3, < 4.0.0)
contracts (~> 0.9)
cucumber (>= 1.3.19)
ffi (~> 1.9)
rspec-expectations (>= 2.99)
thor (~> 0.19)
thor (>= 0.19, < 2.0)
ast (2.4.0)
builder (3.2.3)
builder (3.2.4)
childprocess (3.0.0)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
railties (>= 5.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
contracts (0.16.0)
crass (1.0.4)
crass (1.0.6)
cucumber (1.3.19)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
@ -70,72 +52,64 @@ GEM
multi_test (>= 0.1.2)
diff-lcs (1.3)
erubi (1.9.0)
execjs (2.7.0)
factory_bot (5.1.1)
factory_bot (5.1.2)
activesupport (>= 4.2.0)
ffi (1.11.1)
ffi (1.11.1-java)
ffi (1.12.2)
ffi (1.12.2-java)
gherkin (2.12.2)
multi_json (~> 1.3)
gherkin (2.12.2-java)
multi_json (~> 1.3)
i18n (1.7.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jdbc-sqlite3 (3.28.0)
jquery-rails (4.3.5)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jruby-openssl (0.10.2-java)
loofah (2.3.0)
loofah (2.4.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
method_source (0.9.2)
method_source (1.0.0)
mini_portile2 (2.4.0)
minitest (5.12.2)
multi_json (1.13.1)
minitest (5.14.0)
multi_json (1.14.1)
multi_test (0.1.2)
nokogiri (1.10.4)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
nokogiri (1.10.4-java)
parallel (1.17.0)
parser (2.6.5.0)
nokogiri (1.10.9-java)
parallel (1.19.1)
parser (2.7.0.5)
ast (~> 2.4.0)
power_assert (1.1.5)
powerpack (0.1.2)
rack (2.0.7)
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.2.0)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.3)
actionpack (= 5.2.3)
activesupport (= 5.2.3)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.2.2)
actionpack (= 6.0.2.2)
activesupport (= 6.0.2.2)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.0)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.5)
rake (13.0.1)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.2)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-rails (3.8.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.3)
rspec-support (~> 3.9.0)
rspec-rails (4.0.0)
actionpack (>= 4.2)
activesupport (>= 4.2)
railties (>= 4.2)
rspec-core (~> 3.9)
rspec-expectations (~> 3.9)
rspec-mocks (~> 3.9)
rspec-support (~> 3.9)
rspec-support (3.9.2)
rubocop (0.54.0)
parallel (~> 1.10)
parser (>= 2.5)
@ -144,42 +118,26 @@ GEM
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.1)
sqlite3 (1.4.1)
test-unit (3.3.4)
power_assert
therubyrhino (2.1.2)
therubyrhino_jar (>= 1.7.4, < 1.7.9)
therubyrhino_jar (1.7.8)
thor (0.20.3)
thor (1.0.1)
thread_safe (0.3.6)
thread_safe (0.3.6-java)
tzinfo (1.2.5)
tzinfo (1.2.6)
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.6.0)
unicode-display_width (1.7.0)
zeitwerk (2.3.0)
PLATFORMS
java
ruby
DEPENDENCIES
activerecord-jdbcsqlite3-adapter
appraisal
aruba
coffee-rails
cucumber (= 1.3.19)
factory_bot_rails!
jdbc-sqlite3
jquery-rails
jruby-openssl
rake
rspec-rails
rubocop (= 0.54)
sqlite3
test-unit
therubyrhino
uglifier
BUNDLED WITH
2.0.2
2.1.4

View file

@ -3,8 +3,7 @@ Feature:
I would like the Factory Bot Rails gem to configure Factory Bot as the fixture replacement.
Background:
Given I successfully run `bundle exec rails new testapp -m ../../features/support/rails_template`
And I cd to "testapp"
Given I create a new rails application
And I add "factory_bot_rails" from this project as a dependency
Scenario: Using Factory Bot and Factory Bot Rails with Test Unit generates a factory file and does not generate a fixture file

View file

@ -4,8 +4,7 @@ Feature:
I would like to use factory_bot_rails generators.
Background:
Given I successfully run `bundle exec rails new testapp -m ../../features/support/rails_template`
And I cd to "testapp"
Given I create a new rails application
And I add "factory_bot_rails" from this project as a dependency
And I run `bundle install` with a clean environment

View file

@ -1,10 +1,8 @@
Feature: automatically load factory definitions
Background:
When I successfully run `bundle exec rails new testapp -m ../../features/support/rails_template`
And I cd to "testapp"
When I create a new rails application
And I add "factory_bot_rails" from this project as a dependency
And I add "test-unit" as a dependency
And I run `bundle install` with a clean environment
And I write to "db/migrate/1_create_users.rb" with:
"""

View file

@ -4,10 +4,8 @@ Feature:
So that factory_bot_rails doesn't hold onto stale class references
Scenario: Editing a model without editing the factory
When I successfully run `bundle exec rails new testapp -m ../../features/support/rails_template`
And I cd to "testapp"
When I create a new rails application
And I add "factory_bot_rails" from this project as a dependency
And I add "test-unit" as a dependency
And I run `bundle install` with a clean environment
And I write to "db/migrate/1_create_users.rb" with:
"""
@ -65,10 +63,8 @@ Feature:
And the output should not contain "Failure:"
Scenario: Initializing the reloader with I18n support
When I successfully run `bundle exec rails new testapp -m ../../features/support/rails_template`
And I cd to "testapp"
When I create a new rails application
And I add "factory_bot_rails" from this project as a dependency
And I add "test-unit" as a dependency
And I run `bundle install` with a clean environment
And I run `bundle exec rake db:migrate` with a clean environment
And I write to "app/models/user.rb" with:

View file

@ -1,3 +1,14 @@
When /^I create a new rails application$/ do
options = "--skip-bootsnap --skip-javascript"
template = "-m ../../features/support/rails_template"
result = run_command("bundle exec rails new test_app #{options} #{template}")
expect(result).to have_output(/README/)
expect(last_command_started).to be_successfully_executed
cd("test_app")
end
When /^I add "([^"]+)" from this project as a dependency$/ do |gem_name|
append_to_file("Gemfile", %{gem "#{gem_name}", :path => "#{PROJECT_ROOT}"\n})
end
@ -16,7 +27,7 @@ end
When /^I configure the factories as:$/ do |string|
append_to_file File.join("config", "application.rb"), <<~RUBY
class Testapp::Application
class TestApp::Application
#{string}
end
RUBY
@ -24,7 +35,7 @@ end
When /^I configure the factories directory as "([^"]+)"$/ do |factory_dir|
append_to_file File.join("config", "application.rb"), <<~RUBY
class Testapp::Application
class TestApp::Application
config.generators do |g|
g.fixture_replacement :factory_bot, :dir => "#{factory_dir}"
end

View file

@ -1 +1,3 @@
if Rails.gem_version < Gem::Version.new('6')
gsub_file "Gemfile", /^gem 'sqlite3'$/, 'gem "sqlite3", "~> 1.3.6"'
end

View file

@ -1,22 +0,0 @@
# This file was generated by Appraisal
source "https://rubygems.org"
gem "appraisal"
gem "aruba"
gem "coffee-rails"
gem "cucumber", "1.3.19"
gem "jquery-rails"
gem "rake"
gem "rspec-rails"
gem "test-unit"
gem "uglifier"
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
gem "jdbc-sqlite3", platforms: :jruby
gem "jruby-openssl", platforms: :jruby
gem "therubyrhino", platforms: :jruby
gem "sqlite3", "~> 1.3.6"
gem "rubocop", "0.54", require: false
gem "rails", "~> 4.2.11"
gemspec name: "factory_bot_rails", path: "../"

View file

@ -4,22 +4,20 @@ source "https://rubygems.org"
gem "appraisal"
gem "aruba"
gem "coffee-rails"
gem "cucumber", "1.3.19"
gem "jquery-rails"
gem "rake"
gem "rspec-rails"
gem "test-unit"
gem "uglifier"
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
gem "jdbc-sqlite3", platforms: :jruby
gem "jruby-openssl", platforms: :jruby
gem "therubyrhino", platforms: :jruby
gem "sqlite3", "~> 1.3.6"
gem "rubocop", "0.54", require: false
gem "activerecord", "~> 5.0.7"
gem "railties", "~> 5.0.7"
gem "actionmailer", "~> 5.0.7"
gem "sass-rails"
gem "sqlite3", "~> 1.3.6"
gem "byebug"
gem "jbuilder", "~> 2.5"
gem "listen", "~> 3.0.5"
gem "puma", "~> 3.0"
gem "rails", "~> 5.0.7", ">= 5.0.7.2"
gem "sass-rails", "~> 5.0"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "uglifier", ">= 1.3.0"
gem "web-console", ">= 3.3.0", group: :development
gemspec name: "factory_bot_rails", path: "../"

View file

@ -4,22 +4,21 @@ source "https://rubygems.org"
gem "appraisal"
gem "aruba"
gem "coffee-rails"
gem "cucumber", "1.3.19"
gem "jquery-rails"
gem "rake"
gem "rspec-rails"
gem "test-unit"
gem "uglifier"
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
gem "jdbc-sqlite3", platforms: :jruby
gem "jruby-openssl", platforms: :jruby
gem "therubyrhino", platforms: :jruby
gem "sqlite3", platforms: :ruby
gem "rubocop", "0.54", require: false
gem "activerecord", "~> 5.1.7"
gem "railties", "~> 5.1.7"
gem "actionmailer", "~> 5.1.7"
gem "sass-rails"
gem "byebug"
gem "capybara", ">= 2.15"
gem "jbuilder", "~> 2.5"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 3.7"
gem "rails", "~> 5.1.7"
gem "sass-rails", "~> 5.0"
gem "selenium-webdriver"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.3.6"
gem "web-console", ">= 3.3.0", group: :development
gemspec name: "factory_bot_rails", path: "../"

View file

@ -4,24 +4,22 @@ source "https://rubygems.org"
gem "appraisal"
gem "aruba"
gem "coffee-rails"
gem "cucumber", "1.3.19"
gem "jquery-rails"
gem "rake"
gem "rspec-rails"
gem "test-unit"
gem "uglifier"
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
gem "jdbc-sqlite3", platforms: :jruby
gem "jruby-openssl", platforms: :jruby
gem "therubyrhino", platforms: :jruby
gem "sqlite3", platforms: :ruby
gem "rubocop", "0.54", require: false
gem "activerecord", "~> 5.2.3"
gem "railties", "~> 5.2.3"
gem "actionmailer", "~> 5.2.3"
gem "bootsnap"
gem "activestorage", "~> 5.2.3"
gem "sass-rails"
gem "byebug"
gem "capybara", ">= 2.15"
gem "chromedriver-helper"
gem "jbuilder", "~> 2.5"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 3.11"
gem "rails", "~> 5.2.4", ">= 5.2.4.2"
gem "sass-rails", "~> 5.0"
gem "selenium-webdriver"
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.3.6"
gem "web-console", ">= 3.3.0", group: :development
gemspec name: "factory_bot_rails", path: "../"

View file

@ -4,33 +4,22 @@ source "https://rubygems.org"
gem "appraisal"
gem "aruba"
gem "coffee-rails"
gem "cucumber", "1.3.19"
gem "jquery-rails"
gem "rake"
gem "rspec-rails"
gem "test-unit"
gem "uglifier"
gem "activerecord-jdbcsqlite3-adapter", platforms: :jruby
gem "jdbc-sqlite3", platforms: :jruby
gem "jruby-openssl", platforms: :jruby
gem "therubyrhino", platforms: :jruby
gem "sqlite3", platforms: :ruby
gem "rubocop", "0.54", require: false
gem "rails", "~> 6.0.0"
gem "bootsnap"
gem "byebug"
gem "capybara"
gem "jbuilder"
gem "listen", "~> 3.1.5"
gem "puma", "~> 3.11"
gem "sass-rails", "~> 5"
gem "capybara", ">= 2.15"
gem "jbuilder", "~> 2.7"
gem "listen", ">= 3.0.5", "< 3.2"
gem "puma", "~> 4.1"
gem "rails", "~> 6.0.2", ">= 6.0.2.2"
gem "sass-rails", ">= 6"
gem "selenium-webdriver"
gem "spring"
gem "spring-watcher-listen"
gem "turbolinks"
gem "web-console", group: :development
gem "spring-watcher-listen", "~> 2.0.0"
gem "sqlite3", "~> 1.4"
gem "web-console", ">= 3.3.0", group: :development
gem "webdrivers"
gem "webpacker"
gemspec name: "factory_bot_rails", path: "../"