Merge pull request #87 from snap-cloud/michael/delint
Setup Pronto and Try Some Delints
This commit is contained in:
commit
86133d7fbe
38 changed files with 236 additions and 138 deletions
1
.flayignore
Normal file
1
.flayignore
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
spec/**/*.rb
|
||||||
24
.github/workflows/pronto.yml
vendored
Normal file
24
.github/workflows/pronto.yml
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
name: Pronto
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pronto:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- run: |
|
||||||
|
git fetch --no-tags --prune --depth=150 origin +refs/heads/*:refs/remotes/origin/*
|
||||||
|
- name: Setup Ruby
|
||||||
|
uses: ruby/setup-ruby@v1
|
||||||
|
- name: Setup bundler # Install only the linters group.
|
||||||
|
run: bundle config --global set without default development test staging production
|
||||||
|
- name: Install pronto
|
||||||
|
run: bundle install --without default development test staging production
|
||||||
|
- name: Run Pronto
|
||||||
|
run: pronto run -f github_status github_pr -c origin/${{ github.base_ref }}
|
||||||
|
env:
|
||||||
|
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }}
|
||||||
|
PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}"
|
||||||
|
|
@ -15,6 +15,14 @@ AllCops:
|
||||||
|
|
||||||
#################### Style ###########################
|
#################### Style ###########################
|
||||||
|
|
||||||
|
Style/CommentAnnotation:
|
||||||
|
Keywords:
|
||||||
|
- TODO-SNAPCON
|
||||||
|
- TODO
|
||||||
|
- OPTIMIZE
|
||||||
|
- HACK
|
||||||
|
- REVIEW
|
||||||
|
|
||||||
##################### Metrics ##################################
|
##################### Metrics ##################################
|
||||||
|
|
||||||
##################### Rails ##################################
|
##################### Rails ##################################
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ env:
|
||||||
matrix:
|
matrix:
|
||||||
- TEST_SUITE=ability
|
- TEST_SUITE=ability
|
||||||
- TEST_SUITE=features
|
- TEST_SUITE=features
|
||||||
- TEST_SUITE=linters
|
|
||||||
- TEST_SUITE=models
|
- TEST_SUITE=models
|
||||||
- TEST_SUITE=controllers
|
- TEST_SUITE=controllers
|
||||||
- TEST_SUITE=rest
|
- TEST_SUITE=rest
|
||||||
|
|
|
||||||
23
Gemfile
23
Gemfile
|
|
@ -115,8 +115,8 @@ end
|
||||||
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
|
gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
|
||||||
|
|
||||||
# data tables
|
# data tables
|
||||||
gem 'jquery-datatables'
|
|
||||||
gem 'ajax-datatables-rails'
|
gem 'ajax-datatables-rails'
|
||||||
|
gem 'jquery-datatables'
|
||||||
|
|
||||||
# for charts
|
# for charts
|
||||||
gem 'chartkick'
|
gem 'chartkick'
|
||||||
|
|
@ -141,9 +141,9 @@ gem 'rqrcode'
|
||||||
gem 'axlsx', git: 'https://github.com/randym/axlsx.git'
|
gem 'axlsx', git: 'https://github.com/randym/axlsx.git'
|
||||||
gem 'axlsx_rails'
|
gem 'axlsx_rails'
|
||||||
|
|
||||||
gem 'sentry-ruby'
|
|
||||||
gem 'sentry-rails'
|
|
||||||
gem 'sentry-delayed_job'
|
gem 'sentry-delayed_job'
|
||||||
|
gem 'sentry-rails'
|
||||||
|
gem 'sentry-ruby'
|
||||||
|
|
||||||
# to make links faster
|
# to make links faster
|
||||||
gem 'turbolinks'
|
gem 'turbolinks'
|
||||||
|
|
@ -225,11 +225,7 @@ gem 'dalli'
|
||||||
group :development do
|
group :development do
|
||||||
# to launch specs when files are modified
|
# to launch specs when files are modified
|
||||||
gem 'guard-rspec'
|
gem 'guard-rspec'
|
||||||
gem 'haml_lint'
|
|
||||||
gem 'spring-commands-rspec'
|
gem 'spring-commands-rspec'
|
||||||
# for static code analisys
|
|
||||||
gem 'rubocop', require: false
|
|
||||||
gem 'rubocop-rspec'
|
|
||||||
# to open mails
|
# to open mails
|
||||||
gem 'letter_opener'
|
gem 'letter_opener'
|
||||||
# view mail at /letter_opener/
|
# view mail at /letter_opener/
|
||||||
|
|
@ -240,6 +236,7 @@ group :development do
|
||||||
gem 'web-console'
|
gem 'web-console'
|
||||||
# as development database
|
# as development database
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
|
# prepend models with db schema
|
||||||
gem 'annotate'
|
gem 'annotate'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -272,7 +269,17 @@ group :test do
|
||||||
gem 'pdf-inspector', require: "pdf/inspector"
|
gem 'pdf-inspector', require: "pdf/inspector"
|
||||||
end
|
end
|
||||||
|
|
||||||
group :development, :test do
|
group :development, :test, :linters do
|
||||||
# as debugger
|
# as debugger
|
||||||
gem 'byebug'
|
gem 'byebug'
|
||||||
|
gem 'pry'
|
||||||
|
|
||||||
|
# Linters and static analysis.
|
||||||
|
gem 'pronto', require: false
|
||||||
|
gem 'pronto-flay', require: false
|
||||||
|
gem 'pronto-haml', require: false
|
||||||
|
gem 'pronto-rubocop', require: false
|
||||||
|
gem 'rubocop-rspec', require: false
|
||||||
|
|
||||||
|
gem 'haml-lint', require: false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
50
Gemfile.lock
50
Gemfile.lock
|
|
@ -184,6 +184,11 @@ GEM
|
||||||
fastimage (2.1.4)
|
fastimage (2.1.4)
|
||||||
feature (1.4.0)
|
feature (1.4.0)
|
||||||
ffi (1.10.0)
|
ffi (1.10.0)
|
||||||
|
flay (2.12.1)
|
||||||
|
erubis (~> 2.7.0)
|
||||||
|
path_expander (~> 1.0)
|
||||||
|
ruby_parser (~> 3.0)
|
||||||
|
sexp_processor (~> 4.0)
|
||||||
font-awesome-rails (4.7.0.5)
|
font-awesome-rails (4.7.0.5)
|
||||||
railties (>= 3.2, < 6.1)
|
railties (>= 3.2, < 6.1)
|
||||||
formatador (0.2.5)
|
formatador (0.2.5)
|
||||||
|
|
@ -193,6 +198,9 @@ GEM
|
||||||
formtastic (>= 3.0)
|
formtastic (>= 3.0)
|
||||||
geckodriver-helper (0.23.0)
|
geckodriver-helper (0.23.0)
|
||||||
archive-zip (~> 0.7)
|
archive-zip (~> 0.7)
|
||||||
|
gitlab (4.17.0)
|
||||||
|
httparty (~> 0.18)
|
||||||
|
terminal-table (~> 1.5, >= 1.5.1)
|
||||||
globalid (0.4.2)
|
globalid (0.4.2)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
gravtastic (3.2.6)
|
gravtastic (3.2.6)
|
||||||
|
|
@ -213,6 +221,8 @@ GEM
|
||||||
haml (5.0.4)
|
haml (5.0.4)
|
||||||
temple (>= 0.8.0)
|
temple (>= 0.8.0)
|
||||||
tilt
|
tilt
|
||||||
|
haml-lint (0.999.999)
|
||||||
|
haml_lint
|
||||||
haml-rails (1.0.0)
|
haml-rails (1.0.0)
|
||||||
actionpack (>= 4.0.1)
|
actionpack (>= 4.0.1)
|
||||||
activesupport (>= 4.0.1)
|
activesupport (>= 4.0.1)
|
||||||
|
|
@ -236,6 +246,9 @@ GEM
|
||||||
htmlentities (4.3.4)
|
htmlentities (4.3.4)
|
||||||
http-cookie (1.0.3)
|
http-cookie (1.0.3)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
|
httparty (0.18.1)
|
||||||
|
mime-types (~> 3.0)
|
||||||
|
multi_xml (>= 0.5.2)
|
||||||
i18n (1.8.9)
|
i18n (1.8.9)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
i18n_data (0.8.0)
|
i18n_data (0.8.0)
|
||||||
|
|
@ -320,6 +333,9 @@ GEM
|
||||||
multi_json (~> 1.3)
|
multi_json (~> 1.3)
|
||||||
multi_xml (~> 0.5)
|
multi_xml (~> 0.5)
|
||||||
rack (>= 1.2, < 3)
|
rack (>= 1.2, < 3)
|
||||||
|
octokit (4.20.0)
|
||||||
|
faraday (>= 0.9)
|
||||||
|
sawyer (~> 0.8.0, >= 0.5.3)
|
||||||
omniauth (1.9.1)
|
omniauth (1.9.1)
|
||||||
hashie (>= 3.4.6)
|
hashie (>= 3.4.6)
|
||||||
rack (>= 1.6.2, < 3)
|
rack (>= 1.6.2, < 3)
|
||||||
|
|
@ -349,6 +365,7 @@ GEM
|
||||||
parallel (1.18.0)
|
parallel (1.18.0)
|
||||||
parser (2.6.5.0)
|
parser (2.6.5.0)
|
||||||
ast (~> 2.4.0)
|
ast (~> 2.4.0)
|
||||||
|
path_expander (1.1.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
pdf-inspector (1.3.0)
|
pdf-inspector (1.3.0)
|
||||||
pdf-reader (>= 1.0, < 3.0.a)
|
pdf-reader (>= 1.0, < 3.0.a)
|
||||||
|
|
@ -375,6 +392,24 @@ GEM
|
||||||
rails (>= 3.1.0)
|
rails (>= 3.1.0)
|
||||||
prawn-table (0.2.2)
|
prawn-table (0.2.2)
|
||||||
prawn (>= 1.3.0, < 3.0.0)
|
prawn (>= 1.3.0, < 3.0.0)
|
||||||
|
pronto (0.11.0)
|
||||||
|
gitlab (~> 4.4, >= 4.4.0)
|
||||||
|
httparty (>= 0.13.7)
|
||||||
|
octokit (~> 4.7, >= 4.7.0)
|
||||||
|
rainbow (>= 2.2, < 4.0)
|
||||||
|
rexml (~> 3.2)
|
||||||
|
rugged (>= 0.23.0, < 1.1.0)
|
||||||
|
thor (>= 0.20.3, < 2.0)
|
||||||
|
pronto-flay (0.11.0)
|
||||||
|
flay (~> 2.8)
|
||||||
|
pronto (~> 0.11.0)
|
||||||
|
pronto-haml (0.11.0)
|
||||||
|
haml_lint (~> 0.23)
|
||||||
|
pronto (~> 0.11.0)
|
||||||
|
rubocop (< 1.0)
|
||||||
|
pronto-rubocop (0.11.1)
|
||||||
|
pronto (~> 0.11.0)
|
||||||
|
rubocop (>= 0.63.1, < 2.0)
|
||||||
pry (0.10.4)
|
pry (0.10.4)
|
||||||
coderay (~> 1.1.0)
|
coderay (~> 1.1.0)
|
||||||
method_source (~> 0.8.1)
|
method_source (~> 0.8.1)
|
||||||
|
|
@ -463,6 +498,7 @@ GEM
|
||||||
http-cookie (>= 1.0.2, < 2.0)
|
http-cookie (>= 1.0.2, < 2.0)
|
||||||
mime-types (>= 1.16, < 4.0)
|
mime-types (>= 1.16, < 4.0)
|
||||||
netrc (~> 0.8)
|
netrc (~> 0.8)
|
||||||
|
rexml (3.2.4)
|
||||||
rolify (5.2.0)
|
rolify (5.2.0)
|
||||||
rqrcode (0.10.1)
|
rqrcode (0.10.1)
|
||||||
chunky_png (~> 1.0)
|
chunky_png (~> 1.0)
|
||||||
|
|
@ -509,6 +545,7 @@ GEM
|
||||||
ruby_parser (3.11.0)
|
ruby_parser (3.11.0)
|
||||||
sexp_processor (~> 4.9)
|
sexp_processor (~> 4.9)
|
||||||
rubyzip (1.3.0)
|
rubyzip (1.3.0)
|
||||||
|
rugged (1.0.1)
|
||||||
safe_yaml (1.0.4)
|
safe_yaml (1.0.4)
|
||||||
sass (3.7.2)
|
sass (3.7.2)
|
||||||
sass-listen (~> 4.0.0)
|
sass-listen (~> 4.0.0)
|
||||||
|
|
@ -524,6 +561,9 @@ GEM
|
||||||
sassc (2.0.1)
|
sassc (2.0.1)
|
||||||
ffi (~> 1.9)
|
ffi (~> 1.9)
|
||||||
rake
|
rake
|
||||||
|
sawyer (0.8.2)
|
||||||
|
addressable (>= 2.3.5)
|
||||||
|
faraday (> 0.8, < 2.0)
|
||||||
selectize-rails (0.12.6)
|
selectize-rails (0.12.6)
|
||||||
selenium-webdriver (3.142.6)
|
selenium-webdriver (3.142.6)
|
||||||
childprocess (>= 0.5, < 4.0)
|
childprocess (>= 0.5, < 4.0)
|
||||||
|
|
@ -575,6 +615,8 @@ GEM
|
||||||
stripe (> 5, < 6)
|
stripe (> 5, < 6)
|
||||||
sysexits (1.2.0)
|
sysexits (1.2.0)
|
||||||
temple (0.8.0)
|
temple (0.8.0)
|
||||||
|
terminal-table (1.8.0)
|
||||||
|
unicode-display_width (~> 1.1, >= 1.1.1)
|
||||||
thor (1.1.0)
|
thor (1.1.0)
|
||||||
thread_safe (0.3.6)
|
thread_safe (0.3.6)
|
||||||
tilt (2.0.9)
|
tilt (2.0.9)
|
||||||
|
|
@ -663,8 +705,8 @@ DEPENDENCIES
|
||||||
geckodriver-helper
|
geckodriver-helper
|
||||||
gravtastic
|
gravtastic
|
||||||
guard-rspec
|
guard-rspec
|
||||||
|
haml-lint
|
||||||
haml-rails
|
haml-rails
|
||||||
haml_lint
|
|
||||||
iso-639
|
iso-639
|
||||||
jquery-datatables
|
jquery-datatables
|
||||||
jquery-rails
|
jquery-rails
|
||||||
|
|
@ -689,6 +731,11 @@ DEPENDENCIES
|
||||||
piwik_analytics (~> 1.0.1)
|
piwik_analytics (~> 1.0.1)
|
||||||
prawn-qrcode
|
prawn-qrcode
|
||||||
prawn-rails
|
prawn-rails
|
||||||
|
pronto
|
||||||
|
pronto-flay
|
||||||
|
pronto-haml
|
||||||
|
pronto-rubocop
|
||||||
|
pry
|
||||||
puma (~> 3.0)
|
puma (~> 3.0)
|
||||||
rails (~> 5.2)
|
rails (~> 5.2)
|
||||||
rails-assets-bootstrap-markdown!
|
rails-assets-bootstrap-markdown!
|
||||||
|
|
@ -713,7 +760,6 @@ DEPENDENCIES
|
||||||
rqrcode
|
rqrcode
|
||||||
rspec-activemodel-mocks
|
rspec-activemodel-mocks
|
||||||
rspec-rails
|
rspec-rails
|
||||||
rubocop
|
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
ruby-oembed
|
ruby-oembed
|
||||||
sass-rails (>= 4.0.2)
|
sass-rails (>= 4.0.2)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UserDatatable < AjaxDatatablesRails::Base
|
class UserDatatable < AjaxDatatablesRails::Base
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,8 @@ module ApplicationHelper
|
||||||
'hidden' if Date.today > conference.end_date
|
'hidden' if Date.today > conference.end_date
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO:Snap!Con: Replace this with a search for a conference logo.
|
# TODO-SNAPCON: Replace this with a search for a conference logo.
|
||||||
|
# TODO: If conference is defined, the alt text should be conference name.
|
||||||
def nav_root_link_for(conference = nil)
|
def nav_root_link_for(conference = nil)
|
||||||
path = conference&.id.present? ? conference_path(conference) : root_path
|
path = conference&.id.present? ? conference_path(conference) : root_path
|
||||||
link_to(
|
link_to(
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ module ConferenceHelper
|
||||||
|
|
||||||
def short_ticket_description(ticket)
|
def short_ticket_description(ticket)
|
||||||
return unless ticket.description
|
return unless ticket.description
|
||||||
|
|
||||||
markdown(ticket.description.split("\n").first&.strip)
|
markdown(ticket.description.split("\n").first&.strip)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -221,7 +221,7 @@ module EventsHelper
|
||||||
def calendar_event_text(event, event_schedule, conference)
|
def calendar_event_text(event, event_schedule, conference)
|
||||||
<<~TEXT
|
<<~TEXT
|
||||||
#{conference.title} - #{event.title}
|
#{conference.title} - #{event.title}
|
||||||
#{event_schedule.start_time.strftime("%Y %B %e - %H:%M")} #{event_schedule.timezone}
|
#{event_schedule.start_time.strftime('%Y %B %e - %H:%M')} #{event_schedule.timezone}
|
||||||
|
|
||||||
More Info: #{conference_program_proposal_url(conference, event)}
|
More Info: #{conference_program_proposal_url(conference, event)}
|
||||||
Join: #{event.url}
|
Join: #{event.url}
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,6 @@ class Event < ApplicationRecord
|
||||||
event_schedules.find_by(schedule_id: selected_schedule_id).try(:happening_now?)
|
event_schedules.find_by(schedule_id: selected_schedule_id).try(:happening_now?)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Returns true or false, if the event is already over or not
|
# Returns true or false, if the event is already over or not
|
||||||
#
|
#
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ class Payment < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def stripe_description
|
def stripe_description
|
||||||
#"ticket purchases(#{user.username})"
|
# "ticket purchases(#{user.username})"
|
||||||
"Tickets for #{conference.title} #{user.name} #{user.email}"
|
"Tickets for #{conference.title} #{user.name} #{user.email}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,7 @@ end
|
||||||
def count_purchased_registration_tickets(conference, purchases)
|
def count_purchased_registration_tickets(conference, purchases)
|
||||||
# TODO: WHAT CAUSED THIS???
|
# TODO: WHAT CAUSED THIS???
|
||||||
return 0 unless purchases
|
return 0 unless purchases
|
||||||
|
|
||||||
conference.tickets.for_registration.inject(0) do |sum, registration_ticket|
|
conference.tickets.for_registration.inject(0) do |sum, registration_ticket|
|
||||||
sum + purchases[registration_ticket.id.to_s].to_i
|
sum + purchases[registration_ticket.id.to_s].to_i
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,8 @@ class User < ApplicationRecord
|
||||||
[:database_authenticatable, :registerable,
|
[:database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :trackable, :validatable, :confirmable,
|
:recoverable, :rememberable, :trackable, :validatable, :confirmable,
|
||||||
:omniauthable,
|
:omniauthable,
|
||||||
omniauth_providers: [:suse, :google, :facebook, :github, :discourse]
|
omniauth_providers: [:suse, :google, :facebook, :github, :discourse]]
|
||||||
# omniauth_providers: [:google, :discourse]
|
# omniauth_providers: [:google, :discourse]
|
||||||
]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
devise(*devise_modules)
|
devise(*devise_modules)
|
||||||
|
|
@ -206,6 +205,7 @@ class User < ApplicationRecord
|
||||||
# Partials should *not* directly call `gravatar_url`
|
# Partials should *not* directly call `gravatar_url`
|
||||||
def profile_picture(opts = {})
|
def profile_picture(opts = {})
|
||||||
return gravatar_url(opts) unless picture.present?
|
return gravatar_url(opts) unless picture.present?
|
||||||
|
|
||||||
size = (opts[:size] || 0).to_i
|
size = (opts[:size] || 0).to_i
|
||||||
if size < 50
|
if size < 50
|
||||||
picture.tiny.url
|
picture.tiny.url
|
||||||
|
|
@ -346,7 +346,6 @@ class User < ApplicationRecord
|
||||||
events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer')
|
events.where(program_id: conference.program.id, 'event_users.event_role': 'volunteer')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.empty?
|
def self.empty?
|
||||||
User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
User.count == 1 && User.first.email == 'deleted@localhost.osem'
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ Devise.setup do |config|
|
||||||
name: 'google',
|
name: 'google',
|
||||||
scope: 'email'
|
scope: 'email'
|
||||||
|
|
||||||
# TODO (snapcon): This ought to be configurable. Use OSEM_DISCOURSE_KEY?
|
# TODO-SNAPCON: This ought to be configurable. Use OSEM_DISCOURSE_KEY?
|
||||||
config.omniauth :discourse,
|
config.omniauth :discourse,
|
||||||
sso_url: 'https://forum.snap.berkeley.edu/session/sso_provider',
|
sso_url: 'https://forum.snap.berkeley.edu/session/sso_provider',
|
||||||
sso_secret: ENV['OSEM_DISCOURSE_SECRET']
|
sso_secret: ENV['OSEM_DISCOURSE_SECRET']
|
||||||
|
|
|
||||||
|
|
@ -46,9 +46,9 @@ end
|
||||||
lowlevel_error_handler do |ex, env|
|
lowlevel_error_handler do |ex, env|
|
||||||
Sentry.capture_exception(
|
Sentry.capture_exception(
|
||||||
ex,
|
ex,
|
||||||
:message => ex.message,
|
message: ex.message,
|
||||||
:extra => { :puma => env },
|
extra: { puma: env },
|
||||||
:transaction => "Puma"
|
transaction: "Puma"
|
||||||
)
|
)
|
||||||
# note the below is just a Rack response
|
# note the below is just a Rack response
|
||||||
[500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact conference@snap.berkeley.edu\n"]]
|
[500, {}, ["An error has occurred, and engineers have been informed. Please reload the page. If you continue to have problems, contact conference@snap.berkeley.edu\n"]]
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ describe Admin::ConferencesController do
|
||||||
expect(response).to render_template :show
|
expect(response).to render_template :show
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO (snapcon): This is currently disabled due to slow performance.
|
# TODO-SNAPCON: This is currently disabled due to slow performance.
|
||||||
skip 'assigns conference withdrawn events distribution to event_type_distribution_withdrawn' do
|
skip 'assigns conference withdrawn events distribution to event_type_distribution_withdrawn' do
|
||||||
conference
|
conference
|
||||||
create(:event, program: conference.program)
|
create(:event, program: conference.program)
|
||||||
|
|
@ -122,7 +122,7 @@ describe Admin::ConferencesController do
|
||||||
expect(assigns(:event_type_distribution_withdrawn)).to eq(result)
|
expect(assigns(:event_type_distribution_withdrawn)).to eq(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO (snapcon): This is currently disabled due to slow performance.
|
# TODO-SNAPCON: This is currently disabled due to slow performance.
|
||||||
skip 'assigns conference withdrawn difficulty level distribution to difficulty_levels_distribution_withdrawn' do
|
skip 'assigns conference withdrawn difficulty level distribution to difficulty_levels_distribution_withdrawn' do
|
||||||
conference
|
conference
|
||||||
create(:event, program: conference.program)
|
create(:event, program: conference.program)
|
||||||
|
|
@ -146,7 +146,7 @@ describe Admin::ConferencesController do
|
||||||
expect(assigns(:difficulty_levels_distribution_withdrawn)).to eq(result)
|
expect(assigns(:difficulty_levels_distribution_withdrawn)).to eq(result)
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO (snapcon): This is currently disabled due to slow performance.
|
# TODO-SNAPCON: This is currently disabled due to slow performance.
|
||||||
skip 'assigns conference withdrawn track distribution to tracks_distribution_withdrawn' do
|
skip 'assigns conference withdrawn track distribution to tracks_distribution_withdrawn' do
|
||||||
conference
|
conference
|
||||||
create(:event, program: conference.program)
|
create(:event, program: conference.program)
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ describe UserDatatable do
|
||||||
end
|
end
|
||||||
|
|
||||||
let(:data_cols) do
|
let(:data_cols) do
|
||||||
[:id, :confirmed_at, :email, :name, :attended, :roles, :view_url, :edit_url, :DT_RowId]
|
[:id, :confirmed_at, :email, :name, :username, :attended, :roles, :view_url, :edit_url, :DT_RowId]
|
||||||
end
|
end
|
||||||
let(:view) do
|
let(:view) do
|
||||||
view = double(
|
view = double(
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,8 @@ feature Commercial do
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'does not add an invalid commercial of an event', feature: true, js: true do
|
scenario 'does not add an invalid commercial of an event', feature: true, js: true do
|
||||||
# TODO (snapcon)
|
# TODO-SNAPCON
|
||||||
skip("Snap!Con allows all materials to be saved.")
|
skip('Snap!Con allows all materials to be saved.')
|
||||||
visit edit_conference_program_proposal_path(conference.short_title, event.id)
|
visit edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||||
click_link 'Materials'
|
click_link 'Materials'
|
||||||
fill_in 'commercial_url', with: 'invalid_commercial_url'
|
fill_in 'commercial_url', with: 'invalid_commercial_url'
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ feature 'Has correct abilities' do
|
||||||
expect(page).to_not have_link('New Conference', href: '/admin/conferences/new')
|
expect(page).to_not have_link('New Conference', href: '/admin/conferences/new')
|
||||||
|
|
||||||
visit admin_conference_path(other_conference.short_title)
|
visit admin_conference_path(other_conference.short_title)
|
||||||
# TODO (snapcon): This conference already seems to have a venue.
|
# TODO-SNAPCON: This conference already seems to have a venue.
|
||||||
# expect(page).to have_link('Add venue', href: "/admin/conferences/#{other_conference.short_title}/venue/new")
|
# expect(page).to have_link('Add venue', href: "/admin/conferences/#{other_conference.short_title}/venue/new")
|
||||||
|
|
||||||
visit edit_admin_conference_path(conference.short_title)
|
visit edit_admin_conference_path(conference.short_title)
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ feature 'Version' do
|
||||||
expect(page).to have_text("Someone (probably via the console) deleted difficulty level Expert with ID #{difficulty_level_id} in conference #{conference.short_title}")
|
expect(page).to have_text("Someone (probably via the console) deleted difficulty level Expert with ID #{difficulty_level_id} in conference #{conference.short_title}")
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO (snapcon): Figure out why this is failing!!
|
# TODO-SNAPCON: Figure out why this is failing!!
|
||||||
skip 'display changes in splashpages', feature: true, versioning: true, js: true do
|
skip 'display changes in splashpages', feature: true, versioning: true, js: true do
|
||||||
visit admin_conference_splashpage_path(conference.short_title)
|
visit admin_conference_splashpage_path(conference.short_title)
|
||||||
click_link 'Create Splashpage'
|
click_link 'Create Splashpage'
|
||||||
|
|
@ -300,7 +300,7 @@ feature 'Version' do
|
||||||
|
|
||||||
visit admin_conference_program_event_path(conference.short_title, event_with_commercial)
|
visit admin_conference_program_event_path(conference.short_title, event_with_commercial)
|
||||||
click_link 'History'
|
click_link 'History'
|
||||||
# TODO (snapcon): Figure out why this is here...
|
# TODO-SNAPCON: Figure out why this is here...
|
||||||
# expect(page).to have_text('Someone (probably via the console) created new commercial')
|
# expect(page).to have_text('Someone (probably via the console) created new commercial')
|
||||||
visit admin_conference_program_event_path(conference.short_title, event_without_commercial)
|
visit admin_conference_program_event_path(conference.short_title, event_without_commercial)
|
||||||
click_link 'History'
|
click_link 'History'
|
||||||
|
|
|
||||||
|
|
@ -62,22 +62,36 @@ describe ApplicationHelper, type: :helper do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'navigation title link' do
|
describe 'navigation image link' do
|
||||||
it 'should default to OSEM' do
|
it 'should default to OSEM' do
|
||||||
ENV.delete('OSEM_NAME')
|
ENV.delete('OSEM_NAME')
|
||||||
# TODO:Snap!Con: expect(nav_root_link_for(nil)).to match 'OSEM'
|
expect(nav_root_link_for(nil)).to include image_tag('snapcon_logo.png', alt: 'OSEM')
|
||||||
expect(nav_root_link_for(nil)).to match image_tag('snapcon_logo.png')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should use the environment variable' do
|
it 'should use the environment variable' do
|
||||||
ENV['OSEM_NAME'] = Faker::Company.name + "'"
|
ENV['OSEM_NAME'] = Faker::Company.name + "'"
|
||||||
# expect(nav_root_link_for(nil)).to match h(ENV['OSEM_NAME'])
|
expect(nav_root_link_for(nil)).to include image_tag('snapcon_logo.png', alt: ENV['OSEM_NAME'])
|
||||||
expect(nav_root_link_for(nil)).to match image_tag('snapcon_logo.png')
|
end
|
||||||
|
|
||||||
|
# TODO-SNAPCON: This is an indicator in a conference it should be the conference name.
|
||||||
|
it 'should use the conference organization name' do
|
||||||
|
expect(nav_root_link_for(conference)).to include image_tag('snapcon_logo.png', alt: conference.organization.name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'navigation link titke text' do
|
||||||
|
it 'should default to OSEM' do
|
||||||
|
ENV.delete('OSEM_NAME')
|
||||||
|
expect(nav_link_text(nil)).to match 'OSEM'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should use the environment variable' do
|
||||||
|
ENV['OSEM_NAME'] = Faker::Company.name + "'"
|
||||||
|
expect(nav_link_text(nil)).to match ENV['OSEM_NAME']
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should use the conference organization name' do
|
it 'should use the conference organization name' do
|
||||||
# expect(nav_root_link_for(conference)).to match h(conference.organization.name)
|
expect(nav_link_text(conference)).to match conference.organization.name
|
||||||
expect(nav_root_link_for(nil)).to match image_tag('snapcon_logo.png')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
#
|
#
|
||||||
# index_conferences_on_organization_id (organization_id)
|
# index_conferences_on_organization_id (organization_id)
|
||||||
#
|
#
|
||||||
#!/bin/env ruby
|
# !/bin/env ruby
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Conference do
|
describe Conference do
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ describe Registration do
|
||||||
|
|
||||||
describe 'association' do
|
describe 'association' do
|
||||||
it { is_expected.to belong_to(:user) }
|
it { is_expected.to belong_to(:user) }
|
||||||
# TODO (snapcon): This fails because conference is nil, but obviously this works...
|
# TODO-SNAPCON: This fails because conference is nil, but obviously this works...
|
||||||
# it { is_expected.to belong_to(:conference) }
|
# it { is_expected.to belong_to(:conference) }
|
||||||
it { is_expected.to have_and_belong_to_many(:qanswers) }
|
it { is_expected.to have_and_belong_to_many(:qanswers) }
|
||||||
it { is_expected.to have_and_belong_to_many(:vchoices) }
|
it { is_expected.to have_and_belong_to_many(:vchoices) }
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ def mock_commercial_request
|
||||||
end
|
end
|
||||||
|
|
||||||
def mock_image_request
|
def mock_image_request
|
||||||
WebMock.stub_request(:post, "https://api.cloudinary.com/v1_1/snapcon/image/destroy").
|
# TODO-SNAPCON: This needs to be configurable somehow.
|
||||||
to_return(status: 200, body: {}.to_json, headers: {})
|
WebMock.stub_request(:post, 'https://api.cloudinary.com/v1_1/snapcon/image/destroy')
|
||||||
|
.to_return(status: 200, body: {}.to_json, headers: {})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ module OmniauthMacros
|
||||||
ENV['OSEM_DISCOURSE_KEY'] = 'test key discourse'
|
ENV['OSEM_DISCOURSE_KEY'] = 'test key discourse'
|
||||||
ENV['OSEM_DISCOURSE_SECRET'] = 'test secret discourse'
|
ENV['OSEM_DISCOURSE_SECRET'] = 'test secret discourse'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def mock_auth_new_user
|
def mock_auth_new_user
|
||||||
OmniAuth.config.mock_auth[:google] =
|
OmniAuth.config.mock_auth[:google] =
|
||||||
OmniAuth::AuthHash.new(
|
OmniAuth::AuthHash.new(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue