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

Upgrades pt 2: Ruby 2.7 #860

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.5
2.7.2
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_script:
- npm install
- cp config/database.yml.travis config/database.yml
- psql -c 'create database travis_ci_test;' -U postgres
- RAILS_ENV=test bundle exec rails webdrivers:chromedriver:update
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
script:
- bundle exec rubocop
- $(npm bin)/sass-lint -vq
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.5-stretch
FROM ruby:2.7-slim

RUN mkdir /opt/actioncenter
WORKDIR /opt/actioncenter
Expand Down
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ group :development do
end

group :test do
gem "webmock", "~> 2"
gem "apparition", "~> 0.6"
gem "webmock", "~> 3"
end

group :development, :test do
Expand All @@ -120,13 +121,11 @@ group :development, :test do
gem "cucumber-rails", "1.6.0", require: false
gem "database_cleaner", "~> 1"
gem "factory_girl_rails", "~> 4"
gem "poltergeist", "~> 1"
gem "rails-controller-testing"
gem "rspec-core", "~> 3"
gem "rspec-rails", "~> 3"
gem "rubocop", "0.52.0"
gem "rubocop-github", "0.9.0"
gem "selenium-webdriver", "~> 3"
gem "webdrivers", "~> 4"
end

Expand Down
47 changes: 23 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ GEM
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
after_commit_action (1.1.0)
activerecord (>= 3.0.0)
activesupport (>= 3.0.0)
Expand All @@ -69,6 +69,9 @@ GEM
safely_block (>= 0.1.1)
user_agent_parser
uuidtools
apparition (0.6.0)
capybara (~> 3.13, < 4)
websocket-driver (>= 0.6.5)
arel (7.1.4)
ast (2.4.0)
autoprefixer-rails (9.5.1)
Expand Down Expand Up @@ -122,7 +125,6 @@ GEM
rake (< 13.0)
chronic (0.10.2)
climate_control (0.2.0)
cliver (0.3.2)
cocoon (1.2.12)
coderay (1.1.2)
concurrent-ruby (1.1.5)
Expand All @@ -131,8 +133,8 @@ GEM
activerecord (>= 4.2)
activesupport (>= 4.2)
after_commit_action (~> 1.0)
crack (0.4.3)
safe_yaml (~> 1.0.0)
crack (0.4.5)
rexml
crass (1.0.5)
css_parser (1.7.0)
addressable
Expand Down Expand Up @@ -174,7 +176,7 @@ GEM
responders
warden (~> 1.2.3)
diff-lcs (1.3)
domain_name (0.5.20180417)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.2)
dotenv-rails (2.7.2)
Expand Down Expand Up @@ -218,8 +220,9 @@ GEM
rack
groupdate (2.5.3)
activesupport (>= 3)
hashdiff (0.3.9)
hashdiff (1.0.1)
htmlentities (4.3.4)
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
http_accept_language (2.1.1)
Expand All @@ -243,9 +246,9 @@ GEM
mail (2.7.1)
mini_mime (>= 0.1.1)
method_source (0.9.2)
mime-types (3.2.2)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0331)
mime-types-data (3.2020.1104)
mimemagic (0.3.3)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
Expand Down Expand Up @@ -275,10 +278,6 @@ GEM
pg_search (2.1.7)
activerecord (>= 4.2)
activesupport (>= 4.2)
poltergeist (1.18.1)
capybara (>= 2.1, < 4)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
powerpack (0.1.2)
premailer (1.11.1)
addressable
Expand All @@ -287,7 +286,7 @@ GEM
premailer-rails (1.10.2)
actionmailer (>= 3, < 6)
premailer (~> 1.7, >= 1.7.9)
public_suffix (3.1.1)
public_suffix (4.0.6)
puma (3.12.4)
rack (2.0.8)
rack-attack (5.4.2)
Expand Down Expand Up @@ -369,10 +368,12 @@ GEM
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
rest-client (2.0.2)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.4)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.3)
Expand Down Expand Up @@ -401,7 +402,6 @@ GEM
rubocop (~> 0.51)
ruby-progressbar (1.10.0)
rubyzip (1.3.0)
safe_yaml (1.0.5)
safely_block (0.2.1)
errbase
sanitize (4.6.6)
Expand Down Expand Up @@ -445,13 +445,13 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
tzinfo (1.2.5)
tzinfo (1.2.9)
thread_safe (~> 0.1)
uglifier (4.1.20)
execjs (>= 0.3.0, < 3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.6)
unf_ext (0.0.7.7)
unicode-display_width (1.5.0)
user_agent_parser (2.6.0)
uuidtools (2.1.5)
Expand All @@ -461,10 +461,10 @@ GEM
nokogiri (~> 1.6)
rubyzip (~> 1.0)
selenium-webdriver (>= 3.0, < 4.0)
webmock (2.3.2)
webmock (3.11.2)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
hashdiff (>= 0.4.0, < 2.0.0)
webshims-rails (1.16.0)
rails (> 3.1.0)
websocket-driver (0.6.5)
Expand All @@ -484,6 +484,7 @@ DEPENDENCIES
activerecord-session_store (~> 1)
acts_as_paranoid!
ahoy_matey (~> 1.6)
apparition (~> 0.6)
aws-sdk (~> 2.3)
aws-sdk-rails (~> 1)
better_errors (~> 2)
Expand Down Expand Up @@ -524,7 +525,6 @@ DEPENDENCIES
paperclip (~> 5.2)
pg (~> 1.1)
pg_search
poltergeist (~> 1)
premailer-rails (~> 1)
puma (~> 3)
rack-attack (~> 5)
Expand Down Expand Up @@ -561,17 +561,16 @@ DEPENDENCIES
sass-rails (~> 5.0)
sdoc
select2-rails
selenium-webdriver (~> 3)
sentry-raven (~> 0.15)
sprockets-image_compressor (~> 0)
uglifier (>= 1.3.0)
warden (= 1.2.4)
webdrivers (~> 4)
webmock (~> 2)
webmock (~> 3)
webshims-rails (~> 1)
whenever (~> 0)
will_paginate (~> 3.0)
xmlrpc

BUNDLED WITH
2.0.1
2.1.4
2 changes: 1 addition & 1 deletion app/controllers/admin/petitions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def set_petition

def filtered_signatures
@petition.signatures.
filter(params[:query]).
search(params[:query]).
order(created_at: :desc).
paginate(page: params[:page], per_page: params[:per_page] || 10)
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Signature < ActiveRecord::Base

accepts_nested_attributes_for :affiliations, reject_if: :all_blank

scope :filter, ->(f) do
scope :search, ->(f) do
if f.present?
where("LOWER(email) LIKE ? " +
"OR LOWER(first_name || ' ' || last_name) LIKE ?",
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/admin/petitions_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
expect(response.status).to eq(200)
end

it "passes the 'query' param through Signature.filter" do
it "passes the 'query' param through Signature.search" do
query = "[email protected]"

expect(Petition).to receive(:find) { petition }
expect(petition.signatures).to receive(:filter) do |q|
expect(petition.signatures).to receive(:search) do |q|
expect(q).to eq(query)
Signature.all
end
Expand Down
4 changes: 0 additions & 4 deletions spec/features/action_pages/tweet_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@

it "allows vistors to tweet at representatives" do
visit action_page_path(tweet_action)

expect(page).not_to have_content("THANK YOU!")
fill_in "street_address", with: "1630 Ravello Drive"
fill_in "zipcode", with: "94109"
click_on "Look up your reps"

expect(page).to have_content("Default message")
click_on "Tweet @sisko"

expect(page).to have_content("THANK YOU!")
end
end
Loading