Skip to content
Permalink
Browse files

Update gems with breaking changes, and a few others

  • Loading branch information
harigopal committed Feb 18, 2020
1 parent 2ea1698 commit 840da50ef23e5585962dc447929d41f5ce39ffa8
Showing with 101 additions and 88 deletions.
  1. +6 −0 .rubocop.yml
  2. +5 −4 Gemfile
  3. +13 −8 Gemfile.lock
  4. +1 −1 app/controllers/faculty_controller.rb
  5. +1 −1 spec/factories/admin_user.rb
  6. +1 −1 spec/factories/answer_option.rb
  7. +1 −1 spec/factories/applicant.rb
  8. +1 −1 spec/factories/college.rb
  9. +1 −1 spec/factories/comment.rb
  10. +1 −1 spec/factories/community.rb
  11. +2 −2 spec/factories/content_block.rb
  12. +1 −1 spec/factories/evaluation_criterion.rb
  13. +1 −1 spec/factories/public_slack_message.rb
  14. +1 −1 spec/factories/quiz.rb
  15. +2 −2 spec/factories/resource.rb
  16. +1 −1 spec/factories/school.rb
  17. +1 −1 spec/factories/school_link.rb
  18. +2 −2 spec/factories/startup.rb
  19. +2 −2 spec/factories/startup_feedback.rb
  20. +1 −1 spec/factories/target.rb
  21. +1 −1 spec/factories/target_group.rb
  22. +1 −1 spec/factories/timeline_event.rb
  23. +1 −1 spec/factories/university.rb
  24. +2 −2 spec/factories/user.rb
  25. +1 −1 spec/mailers/previews/faculty_mailer_preview.rb
  26. +1 −1 spec/mailers/previews/founder_mailer_preview.rb
  27. +1 −1 spec/mailers/previews/platform_feedback_mailer_preview.rb
  28. +1 −1 spec/mailers/previews/startup_mailer_preview.rb
  29. +1 −1 spec/mailers/previews/user_mailer_preview.rb
  30. +1 −1 spec/services/courses/clone_service_spec.rb
  31. +2 −2 spec/services/faculty_module/create_service_spec.rb
  32. +1 −1 spec/services/mail_login_token_service_spec.rb
  33. +1 −1 spec/services/startups/team_up_service_spec.rb
  34. +1 −1 spec/services/users/initialize_school_service_spec.rb
  35. +2 −2 spec/system/agreements_spec.rb
  36. +2 −2 spec/system/courses/apply_spec.rb
  37. +1 −1 spec/system/school/admin_spec.rb
  38. +4 −4 spec/system/school/coaches_index_spec.rb
  39. +2 −2 spec/system/school/communities_editor_spec.rb
  40. +2 −1 spec/system/school/courses/curriculum_editor_spec.rb
  41. +1 −1 spec/system/school/courses/evaluation_criteria_index_spec.rb
  42. +6 −6 spec/system/school/courses/students_index_spec.rb
  43. +4 −4 spec/system/school/courses/target_content_editor_spec.rb
  44. +2 −2 spec/system/school/courses_index_spec.rb
  45. +3 −3 spec/system/school/customization_spec.rb
  46. +2 −2 spec/system/students/report_spec.rb
  47. +7 −7 spec/system/submissions/show_spec.rb
  48. +2 −2 spec/system/users/edit_spec.rb
@@ -52,6 +52,12 @@ Metrics/BlockLength:
- 'spec/factories/*'
Lint/ShadowingOuterLocalVariable: # shadowing is a language feature - we should use it where appropriate.
Enabled: false
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true

# Concessions (remove these if possible / appropriate).

@@ -71,7 +71,7 @@ gem 'reform', '~> 2.2' # Form objects decoupled from models. http://www.trailbla
gem 'reform-rails', '~> 0.1'
gem 'virtus', '~> 1.0' # Required for reform coercion. Attributes on Steroids for Plain Old Ruby Objects
gem 'dry-validation', '~> 0.10' # There seems to be a dependency bug in reform's coercion code - it required dry-types.
gem 'postmark-rails', '~> 0.15' # Official integration library for using Rails and ActionMailer with the Postmark HTTP API.
gem 'postmark-rails', '~> 0.19' # Official integration library for using Rails and ActionMailer with the Postmark HTTP API.
# gem 'intercom-rails', '~> 0.4' # The easiest way to install Intercom in a Rails app.
gem 'intercom', '~> 3.5' # Ruby bindings for the Intercom API
gem 'jspdf-rails', '~> 1.0' # HTML5 client-side pdf generation - for certificates
@@ -94,7 +94,7 @@ gem 'pundit', '~> 2.0' # Minimal authorization through OO design and pure Ruby c
gem 'rack-cors', '~> 1.0', require: 'rack/cors' # Rack Middleware for handling CORS, required to serve static assets such as fonts
gem 'jwt', '~> 2.1' # Ruby implementation of the RFC 7519 OAuth JSON Web Token (JWT), used by Zoom API
gem 'chartkick', '~> 3.3' # Create beautiful charts with one line of JavaScript.
gem 'graphql', '= 1.9.12' # Ruby implementation of GraphQL http://graphql-ruby.org
gem 'graphql', '~> 1.10' # Ruby implementation of GraphQL http://graphql-ruby.org
gem 'rodf', '~> 1.1' # ODF generation library for Ruby. https://github.com/westonganger/rodf

# Rails assets!
@@ -145,13 +145,14 @@ group :test do
end

group :development, :test do
gem 'faker', '~> 1.8' # A library for generating fake data such as names, addresses, and phone numbers.
gem 'faker', '~> 2.10' # A library for generating fake data such as names, addresses, and phone numbers.
gem 'rspec-rails', '~> 4.0.0.beta4' # Duh.
gem 'coderay', '~> 1.1' # Pretty syntax highlighting on rspec failure snippets.
gem 'pry-rails', '~> 0.3.5' # Pry debugger.
gem 'webmock', '~> 3.5' # Mocking web requests.
gem 'rubocop', '~> 0.79', require: false # Ruby Style Guide.
gem 'rubocop', '~> 0.80', require: false # Ruby Style Guide.
gem 'rubocop-rails', '~> 2.4', require: false # A RuboCop extension focused on enforcing Rails best practices and coding conventions.
gem 'rubocop-faker'
gem 'bundler-audit', '~> 0.5', require: false # Audit gems in gemfile.lock for reported vulnerabilities
gem 'overcommit', '~> 0.38', require: false # A fully configurable and extendable Git hook manager
gem 'fuubar', '~> 2.5' # The instafailing RSpec progress bar formatter.
@@ -320,8 +320,8 @@ GEM
factory_bot_rails (5.1.1)
factory_bot (~> 5.1.0)
railties (>= 4.2.0)
faker (1.9.6)
i18n (>= 0.7)
faker (2.10.2)
i18n (>= 1.6, < 2)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
fastimage (2.1.7)
@@ -357,7 +357,7 @@ GEM
graphiql-rails (1.7.0)
railties
sprockets-rails
graphql (1.9.12)
graphql (1.10.3)
groupdate (4.3.0)
activesupport (>= 5)
has_scope (0.7.2)
@@ -644,6 +644,7 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.4)
roadie (4.0.0)
css_parser (~> 1.4)
nokogiri (~> 1.8)
@@ -675,13 +676,16 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.9.2)
rubocop (0.79.0)
rubocop (0.80.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
rubocop-faker (0.2.0)
rubocop (>= 0.74)
rubocop-rails (2.4.2)
rack (>= 1.1)
rubocop (>= 0.72.0)
@@ -831,7 +835,7 @@ DEPENDENCIES
dry-validation (~> 0.10)
email_inquire (~> 0.6)
factory_bot_rails (~> 5.0)
faker (~> 1.8)
faker (~> 2.10)
fastimage (~> 2.1)
file_validators (~> 2.1)
font-awesome-rails (~> 4.7)
@@ -840,7 +844,7 @@ DEPENDENCIES
gaffe (~> 1.2)
google_calendar (= 0.6.4)!
graphiql-rails (~> 1.7)
graphql (= 1.9.12)
graphql (~> 1.10)
groupdate (~> 4.0)
heroku-deflater (~> 0.6)
humanize (~> 2.1)
@@ -865,7 +869,7 @@ DEPENDENCIES
omniauth-google-oauth2 (~> 0.6)
overcommit (~> 0.38)
pg (~> 1.0)
postmark-rails (~> 0.15)
postmark-rails (~> 0.19)
pretender (~> 0.3.4)
pry-rails (~> 0.3.5)
puma (~> 4.3)
@@ -903,7 +907,8 @@ DEPENDENCIES
rspec-eventually (~> 0.2.2)
rspec-rails (~> 4.0.0.beta4)
rspec-retry (~> 0.5)
rubocop (~> 0.79)
rubocop (~> 0.80)
rubocop-faker
rubocop-rails (~> 2.4)
sass-rails (>= 6)
scarf (~> 0.2)
@@ -72,7 +72,7 @@ def save_slots_in_list(list, faculty)
# Reset next week slots to empty, while preserving slots with connect requests.
faculty.connect_slots.includes(:connect_request).where(connect_requests: { id: nil }).next_week.destroy_all

list.keys.each do |day|
list.each_key do |day|
day_number = day.to_i

list[day].each do |slot|
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :admin_user do
fullname { Faker::Name.name }
email { Faker::Internet.email(fullname) }
email { Faker::Internet.email(name: fullname) }
end
end
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :answer_option do
quiz_question
value { Faker::Lorem.words(3).join ' ' }
value { Faker::Lorem.words(number: 3).join ' ' }
hint { Faker::Lorem.sentence }
end
end
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :applicant do
email { Faker::Internet.email(name) }
email { Faker::Internet.email(name: name) }
name { Faker::Name.name }
course
end
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :college do
name { Faker::Lorem.words(3).join(' ') }
name { Faker::Lorem.words(number: 3).join(' ') }
city { Faker::Address.city }
state

@@ -1,6 +1,6 @@
FactoryBot.define do
factory :comment do
value { Faker::Lorem.sentences(2).join(" ") }
value { Faker::Lorem.sentences(number: 2).join(" ") }

# required: commentable
# required: creator
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :community do
name { Faker::Lorem.words(2).join(' ') }
name { Faker::Lorem.words(number: 2).join(' ') }
school

trait :target_linkable do
@@ -10,7 +10,7 @@

trait :markdown do
block_type { ContentBlock::BLOCK_TYPE_MARKDOWN }
content { { markdown: Faker::Markdown.sandwich(5) } }
content { { markdown: Faker::Markdown.sandwich(sentences: 5) } }
end

trait :image do
@@ -22,7 +22,7 @@
trait :file do
block_type { ContentBlock::BLOCK_TYPE_FILE }
file { Rack::Test::UploadedFile.new(Rails.root.join('spec/support/uploads/resources/pdf-sample.pdf'), 'application/pdf') }
content { { title: Faker::Lorem.words(3).join(" ").titleize } }
content { { title: Faker::Lorem.words(number: 3).join(" ").titleize } }
end

trait :embed do
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :evaluation_criterion do
sequence(:name) { |i| (Faker::Lorem.words(2) + [i.to_s]).join(' ') }
sequence(:name) { |i| (Faker::Lorem.words(number: 2) + [i.to_s]).join(' ') }
max_grade { 3 }
pass_grade { 2 }
grade_labels { [{ 'grade' => 1, 'label' => 'Bad' }, { 'grade' => 2, 'label' => 'Good' }, { 'grade' => 3, 'label' => 'Great' }] }
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :public_slack_message do
channel { 'general' }
body { Faker::Lorem.words(10).join ' ' }
body { Faker::Lorem.words(number: 10).join ' ' }
slack_username { Faker::Lorem.word }
end
end
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :quiz do
title { Faker::Lorem.words(2) }
title { Faker::Lorem.words(number: 2) }
end
end
@@ -1,8 +1,8 @@
FactoryBot.define do
factory :resource do
file { Rack::Test::UploadedFile.new(Rails.root.join('spec/support/uploads/resources/pdf-sample.pdf'), 'application/pdf') }
title { Faker::Lorem.words(6).join ' ' }
description { Faker::Lorem.words(12).join ' ' }
title { Faker::Lorem.words(number: 6).join ' ' }
description { Faker::Lorem.words(number: 12).join ' ' }
school

factory :resource_video_file do
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :school do
name { Faker::Lorem.words(2).join(' ') }
name { Faker::Lorem.words(number: 2).join(' ') }

trait(:current) do
name { 'test' }
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :school_link do
sequence(:title) { |n| "#{Faker::Lorem.word} #{n}" }
url { |school_link| Faker::Internet.url(school_link.title) }
url { |school_link| Faker::Internet.url(host: school_link.title) }
school

trait(:header) do
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :startup do
sequence(:name) { |n| Faker::Lorem.words(rand(1..3)).push(n).join(' ') }
sequence(:name) { |n| Faker::Lorem.words(number: rand(1..3)).push(n).join(' ') }
level { create :level, :one }

after(:build) do |startup|
@@ -12,7 +12,7 @@

# Use this factory to get an empty startup.
factory :team, class: 'Startup' do
sequence(:name) { |n| Faker::Lorem.words(rand(1..3)).push(n).join(' ') }
sequence(:name) { |n| Faker::Lorem.words(number: rand(1..3)).push(n).join(' ') }
level { create :level, :one }
end
end
@@ -1,7 +1,7 @@
FactoryBot.define do
factory :startup_feedback do
feedback { Faker::Lorem.words(15).join(' ') }
feedback { Faker::Lorem.words(number: 15).join(' ') }
reference_url { Faker::Internet.url }
activity_type { Faker::Lorem.words(5).join(' ') }
activity_type { Faker::Lorem.words(number: 5).join(' ') }
end
end
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :target do
title { Faker::Lorem.words(6).join ' ' }
title { Faker::Lorem.words(number: 6).join ' ' }
role { Target.valid_roles.sample }
target_group
sequence(:sort_index)
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :target_group do
name { Faker::Lorem.words(6).join ' ' }
name { Faker::Lorem.words(number: 6).join ' ' }
sequence(:sort_index)
description { Faker::Lorem.sentence }
level
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :timeline_event do
description { Faker::Lorem.words(10).join ' ' }
description { Faker::Lorem.words(number: 10).join ' ' }
target

factory :timeline_event_with_links do
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :university do
name { Faker::Lorem.words(3).join(' ') }
name { Faker::Lorem.words(number: 3).join(' ') }
state
end
end
@@ -1,8 +1,8 @@
FactoryBot.define do
factory :user do
email { Faker::Internet.email(name) }
email { Faker::Internet.email(name: name) }
name { Faker::Name.name }
school { School.find_by(name: 'test') || create(:school, :current) }
title { Faker::Lorem.words(3).join(' ') }
title { Faker::Lorem.words(number: 3).join(' ') }
end
end
@@ -32,7 +32,7 @@ def connect_request
id: 1,
connect_slot: connect_slot,
startup: Startup.last,
questions: Faker::Lorem.paragraphs(2).join("\n\n"),
questions: Faker::Lorem.paragraphs(number: 2).join("\n\n"),
status: ConnectRequest::STATUS_CONFIRMED,
meeting_link: 'https://example.com/meeting_url'
)
@@ -12,7 +12,7 @@ def connect_request
id: 1,
connect_slot: connect_slot,
startup: Startup.last,
questions: Faker::Lorem.paragraphs(2).join("\n\n"),
questions: Faker::Lorem.paragraphs(number: 2).join("\n\n"),
status: ConnectRequest::STATUS_CONFIRMED,
meeting_link: 'https://example.com/meeting_url'
)
@@ -13,7 +13,7 @@ def platform_feedback
PlatformFeedback.new(
founder: Founder.last,
feedback_type: PlatformFeedback.types_of_feedback.sample,
description: Faker::Lorem.paragraphs(2).join("\n\n")
description: Faker::Lorem.paragraphs(number: 2).join("\n\n")
)
end
end
@@ -26,7 +26,7 @@ def connect_request
id: 1,
connect_slot: connect_slot,
startup: Startup.last,
questions: Faker::Lorem.paragraphs(2).join("\n\n"),
questions: Faker::Lorem.paragraphs(number: 2).join("\n\n"),
status: ConnectRequest::STATUS_CONFIRMED,
meeting_link: 'https://example.com/meeting_url'
)
@@ -23,7 +23,7 @@ def daily_digest

def community_digest(count, starting_id = 1, no_activity = false)
{
community_name: Faker::Lorem.words(2).join(' ').titleize,
community_name: Faker::Lorem.words(number: 2).join(' ').titleize,
questions: (1..count).map do |id|
{
id: starting_id + id - 1,
@@ -23,7 +23,7 @@
let(:ec_1) { create :evaluation_criterion, course: course }
let(:ec_2) { create :evaluation_criterion, course: course }

let(:new_name) { Faker::Lorem.words(2).join(' ') }
let(:new_name) { Faker::Lorem.words(number: 2).join(' ') }

# Quiz target
let!(:quiz_target) { create :target, :with_content, target_group: target_group_l1_1, days_to_complete: 60, role: Target::ROLE_TEAM, resubmittable: false, completion_instructions: Faker::Lorem.sentence }
@@ -3,9 +3,9 @@
describe FacultyModule::CreateService do
subject { described_class }

let(:name) { (Faker::Lorem.words(2).join ' ').titleize }
let(:name) { (Faker::Lorem.words(number: 2).join ' ').titleize }
let(:email) { Faker::Internet.email }
let(:title) { (Faker::Lorem.words(2).join ' ').titleize }
let(:title) { (Faker::Lorem.words(number: 2).join ' ').titleize }
let(:school) { create :school }
let(:course) { create :course, school: school }
let(:faculty) { create :faculty, school: school }

0 comments on commit 840da50

Please sign in to comment.
You can’t perform that action at this time.