Skip to content

Commit

Permalink
Drop EOL Ruby versions
Browse files Browse the repository at this point in the history
Remvoe old versions of ruby from CI
  • Loading branch information
Gustavo Bazan committed Oct 30, 2018
1 parent da2ddcc commit 698182a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 74 deletions.
44 changes: 7 additions & 37 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ sudo: false
cache: bundler
language: ruby
rvm:
- 2.0.0
- 2.1.10
- 2.2.7
- 2.3.4
- 2.4.1
- 2.5.0
- 2.3.8
- 2.4.5
- 2.5.3
- ruby-head
- jruby-9.1.14.0
- jruby-9.1.17.0
- jruby-9.2.0.0
gemfile:
- gemfiles/Gemfile.rails-5-0-stable
- gemfiles/Gemfile.rails-5-1-stable
Expand All @@ -18,38 +16,10 @@ gemfile:
matrix:
allow_failures:
- rvm: ruby-head
exclude:
- rvm: 2.0.0
- rvm: jruby-9.1.17.0
gemfile: Gemfile
- rvm: 2.1.10
- rvm: jruby-9.2.0.0
gemfile: Gemfile
- rvm: jruby-9.1.14.0
gemfile: Gemfile
- rvm: 1.9.3
gemfile: gemfiles/Gemfile.rails-5-0-stable
- rvm: 2.0.0
gemfile: gemfiles/Gemfile.rails-5-0-stable
- rvm: 2.1.10
gemfile: gemfiles/Gemfile.rails-5-0-stable
- rvm: jruby-9.1.14.0
gemfile: gemfiles/Gemfile.rails-5-0-stable
- rvm: jruby-9.1.14.0
gemfile: gemfiles/Gemfile.rails-5-1-stable # rack 2.0.1 requires Ruby version >= 2.2.2; any sol'n for jruby?
- rvm: 1.9.3
gemfile: gemfiles/Gemfile.rails-5-1-stable # rack 2.0.1 requires Ruby version >= 2.2.2
- rvm: 2.0.0
gemfile: gemfiles/Gemfile.rails-5-1-stable # rack 2.0.1 requires Ruby version >= 2.2.2
- rvm: 2.1.10
gemfile: gemfiles/Gemfile.rails-5-1-stable # rack 2.0.1 requires Ruby version >= 2.2.2
- rvm: jruby-9.1.14.0
gemfile: gemfiles/Gemfile.rails-5-2-stable # rack 2.0.1 requires Ruby version >= 2.2.2; any sol'n for jruby?
- rvm: 1.9.3
gemfile: gemfiles/Gemfile.rails-5-2-stable # rack 2.0.1 requires Ruby version >= 2.2.2
- rvm: 2.0.0
gemfile: gemfiles/Gemfile.rails-5-2-stable # rack 2.0.1 requires Ruby version >= 2.2.2
- rvm: 2.1.10
gemfile: gemfiles/Gemfile.rails-5-2-stable # rack 2.0.1 requires Ruby version >= 2.2.2

notifications:
email: false
slack:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Enhancements
* Guess input type more carefully. [@sringling](https://github.com/sringling)
* Allow custom error on forms without model. [@victorperez](https://github.com/victorperez)
* Do not support Ruby < 2.3 anymore. [@gssbzn](https://github.com/gssbzn)

### Bug fix
* Improve disabled option to input_field. [@betelgeuse](https://github.com/betelgeuse)
Expand Down
14 changes: 2 additions & 12 deletions test/inputs/datetime_input_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
class DateTimeInputWithHtml5Test < ActionView::TestCase
test 'input generates a datetime input for datetime attributes if HTML5 compatibility is explicitly enbled' do
with_input_for @user, :created_at, :datetime, html5: true

if ActionPack::VERSION::STRING >= '5'
assert_select 'input[type="datetime-local"]'
elsif ActionPack::VERSION::STRING < '5'
assert_select 'input[type="datetime"]'
end
assert_select 'input[type="datetime-local"]'
end

test 'input generates a datetime select for datetime attributes' do
Expand Down Expand Up @@ -80,12 +75,7 @@ class DateTimeInputWithoutHtml5Test < ActionView::TestCase
test 'input generates a datetime input for datetime attributes if HTML5 compatibility is explicitly enabled' do
swap_wrapper do
with_input_for @user, :created_at, :datetime, html5: true

if ActionPack::VERSION::STRING >= '5'
assert_select 'input[type="datetime-local"]'
elsif ActionPack::VERSION::STRING < '5'
assert_select 'input[type="datetime"]'
end
assert_select 'input[type="datetime-local"]'
end
end

Expand Down
12 changes: 2 additions & 10 deletions test/inputs/priority_input_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ class PriorityInputTest < ActionView::TestCase
test 'input generates a country select field' do
with_input_for @user, :country, :country
assert_select 'select#user_country'
if ActionPack::VERSION::STRING >= '5'
assert_select 'select option[value=BR]', 'Brazil'
elsif ActionPack::VERSION::STRING < '5'
assert_select 'select option[value=Brazil]', 'Brazil'
end
assert_select 'select option[value=BR]', 'Brazil'
assert_no_select 'select option[value=""][disabled=disabled]'
end

test 'input generates a country select with SimpleForm default' do
swap SimpleForm, country_priority: [ 'Brazil' ] do
with_input_for @user, :country, :country
if ActionPack::VERSION::STRING >= '5'
assert_select 'select option[value="---------------"][disabled=disabled]'
elsif ActionPack::VERSION::STRING < '5'
assert_select 'select option[value=""][disabled=disabled]'
end
assert_select 'select option[value="---------------"][disabled=disabled]'
end
end

Expand Down
12 changes: 0 additions & 12 deletions test/inputs/string_input_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ class StringInputTest < ActionView::TestCase
assert_select 'input.string[minlength="5"]'
end

if ActionPack::VERSION::STRING < '5'
test 'input does not get maxlength from validation when tokenizer present' do
with_input_for @validating_user, :action, :string
assert_no_select 'input.string[maxlength]'
end

test 'input does not get minlength from validation when tokenizer present' do
with_input_for @validating_user, :action, :string
assert_no_select 'input.string[minlength]'
end
end

test 'input gets maxlength from validation when :is option present' do
with_input_for @validating_user, :home_picture, :string
assert_select 'input.string[maxlength="12"]'
Expand Down
3 changes: 0 additions & 3 deletions test/support/models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,6 @@ class ValidatingUser < User
only_integer: true
validates_length_of :name, maximum: 25, minimum: 5
validates_length_of :description, in: 15..50
if ActionPack::VERSION::STRING < '5'
validates_length_of :action, maximum: 10, tokenizer: ->(str) { str.scan(/\w+/) }
end
validates_length_of :home_picture, is: 12

def min_amount
Expand Down

0 comments on commit 698182a

Please sign in to comment.