transitionally downgraded to Rails 4.1 since activerecord-jdbcpostgresql-adapter is not fully compatible with Active Record 4.2

This commit is contained in:
Hauke Klement
2015-03-02 15:04:37 +01:00
parent 03486bff35
commit 7477d4c6dd
17 changed files with 107 additions and 174 deletions

View File

@ -4,7 +4,7 @@ gem 'activerecord-jdbcpostgresql-adapter', platform: :jruby
gem 'bcrypt', '~> 3.1.7' gem 'bcrypt', '~> 3.1.7'
gem 'bootstrap-will_paginate' gem 'bootstrap-will_paginate'
gem 'carrierwave' gem 'carrierwave'
gem 'coffee-rails', '~> 4.1.0' gem 'coffee-rails', '~> 4.0.0'
gem 'concurrent-ruby' gem 'concurrent-ruby'
gem 'concurrent-ruby-ext', platform: :ruby gem 'concurrent-ruby-ext', platform: :ruby
gem 'docker-api', require: 'docker' gem 'docker-api', require: 'docker'
@ -20,11 +20,11 @@ gem 'pg', platform: :ruby
gem 'pry' gem 'pry'
gem 'puma' gem 'puma'
gem 'pundit' gem 'pundit'
gem 'rails', '~> 4.2.0' gem 'rails', '~> 4.1.2'
gem 'rails-i18n', '~> 4.0.0' gem 'rails-i18n', '~> 4.0.0'
gem 'ransack' gem 'ransack'
gem 'rubytree' gem 'rubytree'
gem 'sass-rails', '~> 5.0' gem 'sass-rails', '~> 4.0.3'
gem 'sdoc', '~> 0.4.0', group: :doc gem 'sdoc', '~> 0.4.0', group: :doc
gem 'slim' gem 'slim'
gem 'sorcery' gem 'sorcery'

View File

@ -2,48 +2,39 @@ GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
ZenTest (4.11.0) ZenTest (4.11.0)
actionmailer (4.2.0) actionmailer (4.1.9)
actionpack (= 4.2.0) actionpack (= 4.1.9)
actionview (= 4.2.0) actionview (= 4.1.9)
activejob (= 4.2.0)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5) actionpack (4.1.9)
actionpack (4.2.0) actionview (= 4.1.9)
actionview (= 4.2.0) activesupport (= 4.1.9)
activesupport (= 4.2.0) rack (~> 1.5.2)
rack (~> 1.6.0)
rack-test (~> 0.6.2) rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5) actionview (4.1.9)
rails-html-sanitizer (~> 1.0, >= 1.0.1) activesupport (= 4.1.9)
actionview (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1) builder (~> 3.1)
erubis (~> 2.7.0) erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5) activemodel (4.1.9)
rails-html-sanitizer (~> 1.0, >= 1.0.1) activesupport (= 4.1.9)
activejob (4.2.0)
activesupport (= 4.2.0)
globalid (>= 0.3.0)
activemodel (4.2.0)
activesupport (= 4.2.0)
builder (~> 3.1) builder (~> 3.1)
activerecord (4.2.0) activerecord (4.1.9)
activemodel (= 4.2.0) activemodel (= 4.1.9)
activesupport (= 4.2.0) activesupport (= 4.1.9)
arel (~> 6.0) arel (~> 5.0.0)
activerecord-jdbc-adapter (1.3.14) activerecord-jdbc-adapter (1.3.14)
activerecord (>= 2.2) activerecord (>= 2.2)
activerecord-jdbcpostgresql-adapter (1.3.14) activerecord-jdbcpostgresql-adapter (1.3.14)
activerecord-jdbc-adapter (~> 1.3.14) activerecord-jdbc-adapter (~> 1.3.14)
jdbc-postgres (>= 9.1) jdbc-postgres (>= 9.1)
activesupport (4.2.0) activesupport (4.1.9)
i18n (~> 0.7) i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
minitest (~> 5.1) minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.1)
tzinfo (~> 1.1) tzinfo (~> 1.1)
archive-tar-minitar (0.5.2) archive-tar-minitar (0.5.2)
arel (6.0.0) arel (5.0.1.20140414130214)
ast (2.0.0) ast (2.0.0)
astrolabe (1.3.0) astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0) parser (>= 2.2.0.pre.3, < 3.0)
@ -100,7 +91,7 @@ GEM
codeclimate-test-reporter (0.4.7) codeclimate-test-reporter (0.4.7)
simplecov (>= 0.7.1, < 1.0.0) simplecov (>= 0.7.1, < 1.0.0)
coderay (1.1.0) coderay (1.1.0)
coffee-rails (4.1.0) coffee-rails (4.0.1)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
coffee-script (2.3.0) coffee-script (2.3.0)
@ -136,8 +127,6 @@ GEM
ffi (1.9.6) ffi (1.9.6)
ffi (1.9.6-java) ffi (1.9.6-java)
forgery (0.6.0) forgery (0.6.0)
globalid (0.3.3)
activesupport (>= 4.1.0)
highline (1.7.1) highline (1.7.1)
hike (1.2.3) hike (1.2.3)
i18n (0.7.0) i18n (0.7.0)
@ -148,9 +137,8 @@ GEM
activesupport (>= 3.0.0, < 5) activesupport (>= 3.0.0, < 5)
multi_json (~> 1.2) multi_json (~> 1.2)
jdbc-postgres (9.4.1200) jdbc-postgres (9.4.1200)
jquery-rails (4.0.3) jquery-rails (3.1.2)
rails-dom-testing (~> 1.0) railties (>= 3.0, < 5.0)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0) thor (>= 0.14, < 2.0)
jquery-turbolinks (2.1.0) jquery-turbolinks (2.1.0)
railties (>= 3.1.0) railties (>= 3.1.0)
@ -159,8 +147,6 @@ GEM
json (1.8.2-java) json (1.8.2-java)
jwt (1.3.0) jwt (1.3.0)
kramdown (1.6.0) kramdown (1.6.0)
loofah (2.0.1)
nokogiri (>= 1.5.9)
mail (2.6.3) mail (2.6.3)
mime-types (>= 1.16, < 3) mime-types (>= 1.16, < 3)
method_source (0.8.2) method_source (0.8.2)
@ -206,34 +192,25 @@ GEM
rack (>= 1.1, < 2.0) rack (>= 1.1, < 2.0)
pundit (0.3.0) pundit (0.3.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
rack (1.6.0) rack (1.5.2)
rack-test (0.6.3) rack-test (0.6.3)
rack (>= 1.0) rack (>= 1.0)
rails (4.2.0) rails (4.1.9)
actionmailer (= 4.2.0) actionmailer (= 4.1.9)
actionpack (= 4.2.0) actionpack (= 4.1.9)
actionview (= 4.2.0) actionview (= 4.1.9)
activejob (= 4.2.0) activemodel (= 4.1.9)
activemodel (= 4.2.0) activerecord (= 4.1.9)
activerecord (= 4.2.0) activesupport (= 4.1.9)
activesupport (= 4.2.0)
bundler (>= 1.3.0, < 2.0) bundler (>= 1.3.0, < 2.0)
railties (= 4.2.0) railties (= 4.1.9)
sprockets-rails sprockets-rails (~> 2.0)
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.5)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.1)
loofah (~> 2.0)
rails-i18n (4.0.4) rails-i18n (4.0.4)
i18n (~> 0.6) i18n (~> 0.6)
railties (~> 4.0) railties (~> 4.0)
railties (4.2.0) railties (4.1.9)
actionpack (= 4.2.0) actionpack (= 4.1.9)
activesupport (= 4.2.0) activesupport (= 4.1.9)
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0) thor (>= 0.18.1, < 2.0)
rainbow (2.0.0) rainbow (2.0.0)
@ -245,6 +222,7 @@ GEM
i18n i18n
polyamorous (~> 1.1) polyamorous (~> 1.1)
rdoc (4.2.0) rdoc (4.2.0)
json (~> 1.4)
ref (1.0.5) ref (1.0.5)
rspec (3.1.0) rspec (3.1.0)
rspec-core (~> 3.1.0) rspec-core (~> 3.1.0)
@ -280,13 +258,12 @@ GEM
json (~> 1.8) json (~> 1.8)
structured_warnings (~> 0.1) structured_warnings (~> 0.1)
rubyzip (1.1.7) rubyzip (1.1.7)
sass (3.4.13) sass (3.2.19)
sass-rails (5.0.1) sass-rails (4.0.5)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
sass (~> 3.1) sass (~> 3.2.2)
sprockets (>= 2.8, < 4.0) sprockets (~> 2.8, < 3.0)
sprockets-rails (>= 2.0, < 4.0) sprockets-rails (~> 2.0)
tilt (~> 1.1)
sdoc (0.4.1) sdoc (0.4.1)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0) rdoc (~> 4.0)
@ -367,7 +344,7 @@ DEPENDENCIES
capybara capybara
carrierwave carrierwave
codeclimate-test-reporter codeclimate-test-reporter
coffee-rails (~> 4.1.0) coffee-rails (~> 4.0.0)
concurrent-ruby concurrent-ruby
concurrent-ruby-ext concurrent-ruby-ext
database_cleaner database_cleaner
@ -385,7 +362,7 @@ DEPENDENCIES
pry pry
puma puma
pundit pundit
rails (~> 4.2.0) rails (~> 4.1.2)
rails-i18n (~> 4.0.0) rails-i18n (~> 4.0.0)
rake rake
ransack ransack
@ -394,7 +371,7 @@ DEPENDENCIES
rubocop rubocop
rubocop-rspec rubocop-rspec
rubytree rubytree
sass-rails (~> 5.0) sass-rails (~> 4.0.3)
sdoc (~> 0.4.0) sdoc (~> 0.4.0)
selenium-webdriver selenium-webdriver
simplecov simplecov

View File

@ -25,7 +25,7 @@ class Exercise < ActiveRecord::Base
def average_score def average_score
if submissions.exists?(cause: 'submit') if submissions.exists?(cause: 'submit')
maximum_scores_query = submissions.select('MAX(score) AS maximum_score').where(cause: 'submit').group(:user_id).to_sql maximum_scores_query = submissions.select('MAX(score) AS maximum_score').where(cause: 'submit').group(:user_id).to_sql.sub('$1', id.to_s)
self.class.connection.execute("SELECT AVG(maximum_score) AS average_score FROM (#{maximum_scores_query}) AS maximum_scores").first['average_score'].to_f self.class.connection.execute("SELECT AVG(maximum_score) AS average_score FROM (#{maximum_scores_query}) AS maximum_scores").first['average_score'].to_f
end end
end end

View File

@ -1,8 +1,4 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH = File.expand_path('../../config/application', __FILE__) APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot' require_relative '../config/boot'
require 'rails/commands' require 'rails/commands'

View File

@ -1,8 +1,4 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require_relative '../config/boot' require_relative '../config/boot'
require 'rake' require 'rake'
Rake.application.run Rake.application.run

View File

@ -1,29 +0,0 @@
#!/usr/bin/env ruby
require 'pathname'
# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# end
puts "\n== Preparing database =="
system "bin/rake db:setup"
puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
end

View File

@ -1,14 +1,17 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
# This file loads spring without using Bundler, in order to be fast. # This file loads spring without using Bundler, in order to be fast
# It gets overwritten when you run the `spring binstub` command. # It gets overwritten when you run the `spring binstub` command
unless defined?(Spring) unless defined?(Spring)
require "rubygems" require "rubygems"
require "bundler" require "bundler"
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m) if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
Gem.paths = { "GEM_PATH" => Bundler.bundle_path.to_s } ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
ENV["GEM_HOME"] = ""
Gem.paths = ENV
gem "spring", match[1] gem "spring", match[1]
require "spring/binstub" require "spring/binstub"
end end

View File

@ -1,6 +1,13 @@
require File.expand_path('../boot', __FILE__) require File.expand_path('../boot', __FILE__)
require 'rails/all' # Pick the frameworks you want:
require "active_model/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems # Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
@ -21,9 +28,6 @@ module CodeOcean
# config.i18n.default_locale = :de # config.i18n.default_locale = :de
config.i18n.available_locales = [:de, :en] config.i18n.available_locales = [:de, :en]
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
config.autoload_paths << Rails.root.join('lib') config.autoload_paths << Rails.root.join('lib')
config.eager_load_paths << Rails.root.join('lib') config.eager_load_paths << Rails.root.join('lib')
end end

View File

@ -1,3 +1,4 @@
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile. require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])

View File

@ -13,6 +13,8 @@ Rails.application.configure do
config.consider_all_requests_local = true config.consider_all_requests_local = true
config.action_controller.perform_caching = false config.action_controller.perform_caching = false
config.action_mailer.perform_deliveries = true
# Don't care if the mailer can't send. # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false config.action_mailer.raise_delivery_errors = false
@ -22,15 +24,6 @@ Rails.application.configure do
# Raise an error on page load if there are pending migrations. # Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# Adds additional error checking when serving assets at runtime. # Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies. # Checks for improperly declared sprockets dependencies.
# Raises helpful error messages. # Raises helpful error messages.

View File

@ -16,13 +16,11 @@ Rails.application.configure do
# Enable Rack::Cache to put a simple HTTP cache in front of your application # Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this. # Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# NGINX, varnish or squid.
# config.action_dispatch.rack_cache = true # config.action_dispatch.rack_cache = true
# Disable serving static files from the `/public` folder by default since # Disable Rails's static asset server (Apache or nginx will already do this).
# Apache or NGINX already handles this. config.serve_static_assets = false
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
# Compress JavaScripts and CSS. # Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier config.assets.js_compressor = :uglifier
@ -31,22 +29,21 @@ Rails.application.configure do
# Do not fallback to assets pipeline if a precompiled asset is missed. # Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false config.assets.compile = false
# Asset digests allow you to set far-future HTTP expiration dates on all assets, # Generate digests for assets URLs.
# yet still be able to expire them through the digest params.
config.assets.digest = true config.assets.digest = true
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb # Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
# Specifies the header that your server uses for sending files. # Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true # config.force_ssl = true
# Use the lowest log level to ensure availability of diagnostic information # Set to :debug to see everything in the log.
# when problems arise. config.log_level = :info
config.log_level = :debug
# Prepend all log lines with the following tags. # Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ] # config.log_tags = [ :subdomain, :uuid ]
@ -58,7 +55,11 @@ Rails.application.configure do
# config.cache_store = :mem_cache_store # config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server. # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = 'http://assets.example.com' # config.action_controller.asset_host = "http://assets.example.com"
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors. # Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors.
@ -71,6 +72,9 @@ Rails.application.configure do
# Send deprecation notices to registered listeners. # Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed. # Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new config.log_formatter = ::Logger::Formatter.new

View File

@ -12,8 +12,8 @@ Rails.application.configure do
# preloads Rails for running tests, you may have to set it to true. # preloads Rails for running tests, you may have to set it to true.
config.eager_load = false config.eager_load = false
# Configure static file server for tests with Cache-Control for performance. # Configure static asset server for tests with Cache-Control for performance.
config.serve_static_files = true config.serve_static_assets = true
config.static_cache_control = 'public, max-age=3600' config.static_cache_control = 'public, max-age=3600'
# Show full error reports and disable caching. # Show full error reports and disable caching.
@ -31,9 +31,6 @@ Rails.application.configure do
# ActionMailer::Base.deliveries array. # ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test config.action_mailer.delivery_method = :test
# Randomize the order test cases are executed.
config.active_support.test_order = :random
# Print deprecation notices to the stderr. # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr config.active_support.deprecation = :stderr

View File

@ -1,11 +0,0 @@
# Be sure to restart your server when you modify this file.
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'
# Add additional assets to the asset load path
# Rails.application.config.assets.paths << Emoji.images_path
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
# Rails.application.config.assets.precompile += %w( search.js )

View File

@ -1,3 +1,3 @@
# Be sure to restart your server when you modify this file. # Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_CodeOcean_session' Rails.application.config.session_store :cookie_store, key: '_hands-on-programming_session'

View File

@ -1,20 +1,20 @@
FILENAME_REGEXP = /[\w\.]+/ unless Kernel.const_defined?(:FILENAME_REGEXP) FILENAME_REGEXP = /[\w\.]+/ unless Kernel.const_defined?(:FILENAME_REGEXP)
Rails.application.routes.draw do Rails.application.routes.draw do
root 'application#welcome' root to: 'application#welcome'
namespace :admin do namespace :admin do
get 'dashboard' => 'dashboard#show' get 'dashboard', to: 'dashboard#show'
end end
get '/help' => 'application#help' get '/help', to: 'application#help'
resources :consumers resources :consumers
resources :execution_environments do resources :execution_environments do
member do member do
get :shell get :shell
post 'shell' => :execute_command, as: :execute_command post 'shell', as: :execute_command, to: :execute_command
end end
resources :errors, only: [:create, :index, :show] resources :errors, only: [:create, :index, :show]
@ -40,29 +40,29 @@ Rails.application.routes.draw do
resources :internal_users do resources :internal_users do
member do member do
match 'activate' => 'internal_users#activate', via: [:get, :patch, :put] match 'activate', to: 'internal_users#activate', via: [:get, :patch, :put]
match 'reset_password' => 'internal_users#reset_password', via: [:get, :patch, :put] match 'reset_password', to: 'internal_users#reset_password', via: [:get, :patch, :put]
end end
end end
match '/forgot_password' => 'internal_users#forgot_password', as: 'forgot_password', via: [:get, :post] match '/forgot_password', as: 'forgot_password', to: 'internal_users#forgot_password', via: [:get, :post]
resources :sessions, only: [:create, :destroy, :new] resources :sessions, only: [:create, :destroy, :new]
post '/lti/launch' => 'sessions#create_through_lti', as: 'lti_launch' post '/lti/launch', as: 'lti_launch', to: 'sessions#create_through_lti'
get '/lti/return' => 'sessions#destroy_through_lti', as: 'lti_return' get '/lti/return', as: 'lti_return', to: 'sessions#destroy_through_lti'
get '/sign_in' => 'sessions#new', as: 'sign_in' get '/sign_in', as: 'sign_in', to: 'sessions#new'
delete '/sign_out' => 'sessions#destroy', as: 'sign_out' delete '/sign_out', as: 'sign_out', to: 'sessions#destroy'
resources :submissions, only: [:create, :index, :show] do resources :submissions, only: [:create, :index, :show] do
member do member do
get 'download/:filename' => :download_file, as: :download, constraints: {filename: FILENAME_REGEXP} get 'download/:filename', as: :download, constraints: {filename: FILENAME_REGEXP}, to: :download_file
get 'render/:filename' => :render_file, as: :render, constraints: {filename: FILENAME_REGEXP} get 'render/:filename', as: :render, constraints: {filename: FILENAME_REGEXP}, to: :render_file
get 'run/:filename' => :run, as: :run, constraints: {filename: FILENAME_REGEXP} get 'run/:filename', as: :run, constraints: {filename: FILENAME_REGEXP}, to: :run
get :score get :score
get :statistics get :statistics
post :stop post :stop
get 'test/:filename' => :test, as: :test, constraints: {filename: FILENAME_REGEXP} get 'test/:filename', as: :test, constraints: {filename: FILENAME_REGEXP}, to: :test
end end
end end

View File

@ -40,6 +40,8 @@ describe ApplicationController do
let(:locale) { :de } let(:locale) { :de }
context 'when specifying a locale' do context 'when specifying a locale' do
before(:each) { allow(session).to receive(:[]=).at_least(:once) }
context "using the 'custom_locale' parameter" do context "using the 'custom_locale' parameter" do
it 'overwrites the session' do it 'overwrites the session' do
expect(session).to receive(:[]=).with(:locale, locale.to_s) expect(session).to receive(:[]=).with(:locale, locale.to_s)