Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5 Support and update to remove deprecated RSpec Commands #110

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
recurring_select
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.3
ruby-2.2.4
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby

gem 'jquery-rails'

gem 'rails', '~> 4.0.12'
gem 'sass-rails', '~> 4.0.5'
gem 'rails', '~> 5.0.0'
gem 'sass-rails', '~> 5.0.6'
211 changes: 127 additions & 84 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,110 +11,150 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.0.13)
actionpack (= 4.0.13)
actioncable (5.0.0)
actionpack (= 5.0.0)
nio4r (~> 1.2)
websocket-driver (~> 0.6.1)
actionmailer (5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
mail (~> 2.5, >= 2.5.4)
actionpack (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
rails-dom-testing (~> 2.0)
actionpack (5.0.0)
actionview (= 5.0.0)
activesupport (= 5.0.0)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.0)
activesupport (= 5.0.0)
builder (~> 3.1)
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.13)
activesupport (= 4.0.13)
builder (~> 3.1.0)
activerecord (4.0.13)
activemodel (= 4.0.13)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.13)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.4)
activesupport (4.0.13)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
builder (3.1.4)
coffee-rails (4.1.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (5.0.0)
activesupport (= 5.0.0)
globalid (>= 0.3.6)
activemodel (5.0.0)
activesupport (= 5.0.0)
activerecord (5.0.0)
activemodel (= 5.0.0)
activesupport (= 5.0.0)
arel (~> 7.0)
activesupport (5.0.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.1)
builder (3.2.2)
coffee-rails (4.2.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0)
railties (>= 4.0.0, < 5.2.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
diff-lcs (1.2.5)
erubis (2.7.0)
execjs (2.6.0)
hike (1.2.3)
execjs (2.7.0)
globalid (0.3.7)
activesupport (>= 4.1.0)
i18n (0.7.0)
ice_cube (0.13.0)
jquery-rails (3.1.2)
railties (>= 3.0, < 5.0)
ice_cube (0.14.0)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
mail (2.6.3)
mime-types (>= 1.16, < 3)
mime-types (2.6.2)
minitest (4.7.5)
multi_json (1.11.2)
pg (0.17.1)
rack (1.5.5)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
method_source (0.8.2)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.0)
nio4r (1.2.1)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
pg (0.18.4)
pkg-config (1.1.7)
rack (2.0.1)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.0.13)
actionmailer (= 4.0.13)
actionpack (= 4.0.13)
activerecord (= 4.0.13)
activesupport (= 4.0.13)
rails (5.0.0)
actioncable (= 5.0.0)
actionmailer (= 5.0.0)
actionpack (= 5.0.0)
actionview (= 5.0.0)
activejob (= 5.0.0)
activemodel (= 5.0.0)
activerecord (= 5.0.0)
activesupport (= 5.0.0)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.13)
sprockets-rails (~> 2.0)
railties (4.0.13)
actionpack (= 4.0.13)
activesupport (= 4.0.13)
railties (= 5.0.0)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.1)
activesupport (>= 4.2.0, < 6.0)
nokogiri (~> 1.6.0)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (5.0.0)
actionpack (= 5.0.0)
activesupport (= 5.0.0)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (10.4.2)
rspec (3.1.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-core (3.1.7)
rspec-support (~> 3.1.0)
rspec-expectations (3.1.2)
rake (11.2.2)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.2)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.1.0)
rspec-mocks (3.1.3)
rspec-support (~> 3.1.0)
rspec-rails (3.1.0)
rspec-support (~> 3.5.0)
rspec-rails (3.5.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.1.0)
rspec-expectations (~> 3.1.0)
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
sass (3.2.19)
sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2.2)
sprockets (~> 2.8, < 3.0)
sprockets-rails (~> 2.0)
sprockets (2.12.4)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sprockets-rails (2.3.3)
actionpack (>= 3.0)
activesupport (>= 3.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
sass (3.4.22)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sprockets (3.7.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.1.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (0.3.44)
tilt (2.0.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
websocket-driver (0.6.4)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)

PLATFORMS
ruby
Expand All @@ -124,9 +164,12 @@ DEPENDENCIES
bundler (>= 1.3.5)
jquery-rails
pg
rails (~> 4.0.12)
rails (~> 5.0.0)
rake (>= 0.9.6)
recurring_select!
rspec (>= 2.14)
rspec-rails (>= 2.14)
sass-rails (~> 4.0.5)
sass-rails (~> 5.0.6)

BUNDLED WITH
1.12.5
4 changes: 2 additions & 2 deletions app/helpers/recurring_select_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module RecurringSelectHelper
module FormHelper
if Rails::VERSION::MAJOR == 4
if Rails::VERSION::MAJOR >= 4
def select_recurring(object, method, default_schedules = nil, options = {}, html_options = {})
RecurringSelectTag.new(object, method, self, default_schedules, options, html_options).render
end
Expand Down Expand Up @@ -97,7 +97,7 @@ def recurring_select_html_options(html_options)
end

if Rails::VERSION::STRING.to_f >= 4.0
# === Rails 4
# === Rails 4 or 5
class RecurringSelectTag < ActionView::Helpers::Tags::Base
include RecurringSelectHelper::FormOptionsHelper
include SelectHTMLOptions
Expand Down
8 changes: 4 additions & 4 deletions spec/app/helpers/recurring_select_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class FromTester
describe "#recurring_options_for_select" do
it "should use the correct options (basic)" do
subject = FromTester.new
subject.should_receive(:options_for_select).with(
expect(subject).to receive(:options_for_select).with(
[
['- not recurring -', 'null'],
['Set schedule...', 'custom']
Expand All @@ -20,7 +20,7 @@ class FromTester

it "should use the correct options (no defaults but custom rule)" do
subject = FromTester.new
subject.should_receive(:options_for_select).with(
expect(subject).to receive(:options_for_select).with(
[
["Weekly", IceCube::Rule.weekly.to_hash.to_json],
['or', {:disabled => true}],
Expand All @@ -32,7 +32,7 @@ class FromTester

it "should use the correct options (defaults with no rule)" do
subject = FromTester.new
subject.should_receive(:options_for_select).with(
expect(subject).to receive(:options_for_select).with(
[
["Weekly", IceCube::Rule.weekly.to_hash.to_json],
["Monthly", IceCube::Rule.monthly.to_hash.to_json],
Expand All @@ -45,7 +45,7 @@ class FromTester

it "should use the correct options (non-recurring rule with defaults)" do
subject = FromTester.new
subject.should_receive(:options_for_select).with(
expect(subject).to receive(:options_for_select).with(
[
["- not recurring -", 'null'],
["different", 1],
Expand Down
2 changes: 2 additions & 0 deletions spec/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@

# Expands the lines which load the assets
config.assets.debug = true

config.eager_load = false
end
2 changes: 2 additions & 0 deletions spec/dummy/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@

# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify

config.eager_load = true
end
4 changes: 3 additions & 1 deletion spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Configure static asset server for tests with Cache-Control for performance
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }

# Show full error reports and disable caching
config.consider_all_requests_local = true
Expand All @@ -33,4 +33,6 @@

# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr

config.eager_load = false
end
10 changes: 10 additions & 0 deletions spec/gemfiles/Gemfile.rails-5.0.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source "https://rubygems.org"
gemspec :path => "./../.."

gem "pg", platform: :ruby
gem "activerecord-jdbcpostgresql-adapter", platform: :jruby

gem "jquery-rails"

gem "rails", "~> 5.0.0"
gem 'sass-rails', '~> 5.0.0'
Loading