#{item.description}
-
+
Video:#{recording.filename}
EOF
diff --git a/lib/frontend/folder_tree.rb b/lib/frontend/folder_tree.rb
index f18baa3e..4ad4fe4d 100644
--- a/lib/frontend/folder_tree.rb
+++ b/lib/frontend/folder_tree.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Frontend
class FolderNode
def initialize(name = '', path = '')
@@ -12,6 +13,7 @@ def initialize(name = '', path = '')
def add(name)
if @childs.key? name
fail 'rejected: trying to add on a conference nodes, but they are always terminal' if @childs[name].conference_id
+
@childs[name]
else
@childs[name] = FolderNode.new(name, @path)
@@ -33,6 +35,7 @@ def conference
def parent_path
return '' if path == name
+
pos = path.rindex(name) - 2
path[0..pos]
end
@@ -61,6 +64,7 @@ def folders_at(path)
return unless start
end
return unless start
+
start.childs.values
end
diff --git a/lib/frontend/playlist.rb b/lib/frontend/playlist.rb
index 819ac2d2..26897a6e 100644
--- a/lib/frontend/playlist.rb
+++ b/lib/frontend/playlist.rb
@@ -17,6 +17,7 @@ def initialize(playlist, conference: nil, audio: false)
def playlist
return audio_playlist if @audio
+
video_playlist
end
@@ -34,6 +35,7 @@ def poster_url
def title
return @conference.title if @conference
+
lead_event.title
end
@@ -50,6 +52,5 @@ def video_playlist
[event, event.preferred_recording]
end
end
-
end
end
diff --git a/lib/languages.rb b/lib/languages.rb
index 9167506b..391f20ac 100644
--- a/lib/languages.rb
+++ b/lib/languages.rb
@@ -12,7 +12,7 @@ class Languages
'ara' => ['ar', 'Arabic'],
'hrv' => ['hr', 'Croatian'],
'pol' => ['pl', 'Polish'],
-
+
'glg' => ['gl', 'Galician'],
'mlt' => ['mt', 'Maltese'],
'uzb' => ['uz', 'Uzbek'],
diff --git a/lib/mime_type.rb b/lib/mime_type.rb
index a6b36dce..27264cdf 100644
--- a/lib/mime_type.rb
+++ b/lib/mime_type.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
class MimeType
AUDIO = %w(audio/ogg audio/mpeg audio/opus).freeze
VIDEO = %w(video/mp4 video/ogg video/webm).freeze
@@ -59,5 +60,4 @@ def is_audio(mime_type)
a <=> b
end
}
-
-end
\ No newline at end of file
+end
diff --git a/lib/settings.rb b/lib/settings.rb
index 1387d8be..3b486bb3 100644
--- a/lib/settings.rb
+++ b/lib/settings.rb
@@ -1,7 +1,9 @@
# frozen_string_literal: true
+
class Settings
def self.method_missing(name)
fail "not implemented: #{name}" unless config.respond_to?(name)
+
config.public_send(name).freeze
end
diff --git a/lib/tasks/related_events.rake b/lib/tasks/related_events.rake
index 385e380e..f644107f 100644
--- a/lib/tasks/related_events.rake
+++ b/lib/tasks/related_events.rake
@@ -21,4 +21,3 @@ namespace :voctoweb do
end
end
end
-
diff --git a/lib/update_related_events.rb b/lib/update_related_events.rb
index 248f7510..fa44bd77 100644
--- a/lib/update_related_events.rb
+++ b/lib/update_related_events.rb
@@ -66,6 +66,7 @@ def build_graph(related)
@graph.each do |_id, edges|
weights = edges.values
next if weights.count < 2
+
limit = percentile(weights, 0.95)
edges.delete_if { |_k, v| v < limit.to_i }
end
diff --git a/public/404.html b/public/404.html
new file mode 100644
index 00000000..2be3af26
--- /dev/null
+++ b/public/404.html
@@ -0,0 +1,67 @@
+
+
+
+ The page you were looking for doesn't exist (404)
+
+
+
+
+
+
+
+
+
The page you were looking for doesn't exist.
+
You may have mistyped the address or the page may have moved.
+
+
If you are the application owner check the logs for more information.
+
+
+
diff --git a/public/422.html b/public/422.html
index fbb4b84d..c08eac0d 100644
--- a/public/422.html
+++ b/public/422.html
@@ -2,17 +2,23 @@
The change you wanted was rejected (422)
+
-
+
-
The change you wanted was rejected.
-
Maybe you tried to change something you didn't have access to.
+
+
The change you wanted was rejected.
+
Maybe you tried to change something you didn't have access to.
+
+
If you are the application owner check the logs for more information.
- If you are the application owner check the logs for more information.
diff --git a/public/500.html b/public/500.html
index e9052d35..78a030af 100644
--- a/public/500.html
+++ b/public/500.html
@@ -2,17 +2,23 @@
We're sorry, but something went wrong (500)
+
-
+
-
We're sorry, but something went wrong.
+
+
We're sorry, but something went wrong.
+
+
If you are the application owner check the logs for more information.
- If you are the application owner check the logs for more information.
diff --git a/public/robots.txt b/public/robots.txt
index 1a3a5e4d..c19f78ab 100644
--- a/public/robots.txt
+++ b/public/robots.txt
@@ -1,5 +1 @@
-# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
-#
-# To ban all spiders from the entire site uncomment the next two lines:
-# User-agent: *
-# Disallow: /
+# See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
diff --git a/test/controllers/admin/admin_users_controller_test.rb b/test/controllers/admin/admin_users_controller_test.rb
index ba8e354b..8d9b67b3 100644
--- a/test/controllers/admin/admin_users_controller_test.rb
+++ b/test/controllers/admin/admin_users_controller_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class Admin::AdminUsersControllerTest < ActionController::TestCase
-
setup do
@user = create :admin_user
sign_in @user
@@ -23,5 +22,4 @@ class Admin::AdminUsersControllerTest < ActionController::TestCase
get 'show', params: { id: user.id }
assert_response :success
end
-
end
diff --git a/test/controllers/admin/api_keys_controller_test.rb b/test/controllers/admin/api_keys_controller_test.rb
index 3c2089bd..912070d0 100644
--- a/test/controllers/admin/api_keys_controller_test.rb
+++ b/test/controllers/admin/api_keys_controller_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class Admin::ApiKeysControllerTest < ActionController::TestCase
-
setup do
@user = create :admin_user
sign_in @user
@@ -23,5 +22,4 @@ class Admin::ApiKeysControllerTest < ActionController::TestCase
get 'show', params: { id: api_key.id }
assert_response :success
end
-
end
diff --git a/test/controllers/admin/conferences_controller_test.rb b/test/controllers/admin/conferences_controller_test.rb
index ed1fc155..96b7d556 100644
--- a/test/controllers/admin/conferences_controller_test.rb
+++ b/test/controllers/admin/conferences_controller_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class Admin::ConferencesControllerTest < ActionController::TestCase
-
setup do
@user = create :admin_user
sign_in @user
@@ -23,5 +22,4 @@ class Admin::ConferencesControllerTest < ActionController::TestCase
get 'show', params: { id: conference.id }
assert_response :success
end
-
end
diff --git a/test/controllers/admin/dashboard_controller_test.rb b/test/controllers/admin/dashboard_controller_test.rb
index 21d3291b..b0947170 100644
--- a/test/controllers/admin/dashboard_controller_test.rb
+++ b/test/controllers/admin/dashboard_controller_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class Admin::DashboardControllerTest < ActionController::TestCase
-
setup do
@user = create :admin_user
sign_in @user
@@ -17,5 +16,4 @@ class Admin::DashboardControllerTest < ActionController::TestCase
get :index
assert_response :success
end
-
end
diff --git a/test/controllers/admin/events_controller_test.rb b/test/controllers/admin/events_controller_test.rb
index 243f9a18..3f099119 100644
--- a/test/controllers/admin/events_controller_test.rb
+++ b/test/controllers/admin/events_controller_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class Admin::EventsControllerTest < ActionController::TestCase
-
setup do
@user = create :admin_user
sign_in @user
@@ -28,5 +27,4 @@ class Admin::EventsControllerTest < ActionController::TestCase
get 'show', params: { id: 1234 }
end
end
-
end
diff --git a/test/controllers/admin/recordings_controller_test.rb b/test/controllers/admin/recordings_controller_test.rb
index 3c1feb65..2b28137e 100644
--- a/test/controllers/admin/recordings_controller_test.rb
+++ b/test/controllers/admin/recordings_controller_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class Admin::RecordingsControllerTest < ActionController::TestCase
-
setup do
@user = create :admin_user
sign_in @user
@@ -22,5 +21,4 @@ class Admin::RecordingsControllerTest < ActionController::TestCase
get 'show', params: { id: recording.id }
assert_response :success
end
-
end
diff --git a/test/controllers/api/conferences_controller_test.rb b/test/controllers/api/conferences_controller_test.rb
index d803ac40..bd6a12b5 100644
--- a/test/controllers/api/conferences_controller_test.rb
+++ b/test/controllers/api/conferences_controller_test.rb
@@ -13,7 +13,7 @@ class Api::ConferencesControllerTest < ActionController::TestCase
end
test 'should update conference' do
- args = {
+ args = {
conference: {
logo: 'fake-logo',
title: 'fake-title'
diff --git a/test/controllers/api/recordings_controller_test.rb b/test/controllers/api/recordings_controller_test.rb
index e292eb5c..897c5e7d 100644
--- a/test/controllers/api/recordings_controller_test.rb
+++ b/test/controllers/api/recordings_controller_test.rb
@@ -60,7 +60,7 @@ class Api::RecordingsControllerTest < ActionController::TestCase
test 'should update recording' do
recording = Recording.last
- args = {
+ args = {
recording: {
filename: 'fake-filename',
length: '236',
diff --git a/test/controllers/frontend/events_controller_test.rb b/test/controllers/frontend/events_controller_test.rb
index 39b68ee0..079c0002 100644
--- a/test/controllers/frontend/events_controller_test.rb
+++ b/test/controllers/frontend/events_controller_test.rb
@@ -5,7 +5,7 @@ class EventsControllerTest < ActionController::TestCase
def setup
@conference = create :conference, slug: '123'
@event = create :event, conference: @conference, slug: 'abc'
- @recording = create :recording, event: @event, filename: 'abc', mime_type: 'video/mp4', language: 'eng'
+ @recording = create :recording, event: @event, filename: 'abc', mime_type: 'video/mp4', language: 'eng'
end
test 'should get show with slug' do
diff --git a/test/controllers/graphql_controller_test.rb b/test/controllers/graphql_controller_test.rb
index 59b202c4..622209e8 100644
--- a/test/controllers/graphql_controller_test.rb
+++ b/test/controllers/graphql_controller_test.rb
@@ -6,7 +6,7 @@ class GraphqlControllerTest < ActionController::TestCase
end
test 'should list conferences' do
- post 'execute', params: {
+ post 'execute', params: {
query: " {
allConferences(first:10) {id, title}
} "
@@ -14,4 +14,4 @@ class GraphqlControllerTest < ActionController::TestCase
assert_response :success
assert JSON.parse(response.body)
end
-end
\ No newline at end of file
+end
diff --git a/test/controllers/public/conferences_controller_test.rb b/test/controllers/public/conferences_controller_test.rb
index 0d369d80..a7082595 100644
--- a/test/controllers/public/conferences_controller_test.rb
+++ b/test/controllers/public/conferences_controller_test.rb
@@ -29,7 +29,6 @@ class Public::ConferencesControllerTest < ActionController::TestCase
refute_empty json['acronym']
end
-
test "should return 404 error" do
get :show, params: { id: 123 }, format: :json
assert_response :not_found
diff --git a/test/integration/conferences_api_test.rb b/test/integration/conferences_api_test.rb
index 36b214e6..f716ae05 100644
--- a/test/integration/conferences_api_test.rb
+++ b/test/integration/conferences_api_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class ConferencesApiTest < ActionDispatch::IntegrationTest
-
setup do
@key = create(:api_key)
@json = json_text
@@ -30,6 +29,4 @@ def json_text
end
end
end
-
end
-
diff --git a/test/integration/events_api_test.rb b/test/integration/events_api_test.rb
index 6fa2849c..b706e6a6 100644
--- a/test/integration/events_api_test.rb
+++ b/test/integration/events_api_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class EventsApiTest < ActionDispatch::IntegrationTest
-
setup do
@key = create(:api_key)
@conference = create(:conference)
diff --git a/test/integration/graphql/conferences_test.rb b/test/integration/graphql/conferences_test.rb
index 6d93ddd3..8cb130d9 100644
--- a/test/integration/graphql/conferences_test.rb
+++ b/test/integration/graphql/conferences_test.rb
@@ -2,7 +2,6 @@
require 'json'
class ConferencesGraphQLApiTest < ActionDispatch::IntegrationTest
-
test 'load conference by acronym/id' do
query_string = <<-GRAPHQL
query($id: ID!) {
@@ -38,7 +37,6 @@ class ConferencesGraphQLApiTest < ActionDispatch::IntegrationTest
assert_nil result['errors']
end
-
test 'load newest conference' do
query_string = <<-GRAPHQL
query {
@@ -91,5 +89,4 @@ class ConferencesGraphQLApiTest < ActionDispatch::IntegrationTest
assert_nil result['errors']
assert result['data']['conferencesRecent'].length == 1
end
-
end
diff --git a/test/integration/graphql/lecture_test.rb b/test/integration/graphql/lecture_test.rb
index 19d8abe0..7f2ea72e 100644
--- a/test/integration/graphql/lecture_test.rb
+++ b/test/integration/graphql/lecture_test.rb
@@ -2,7 +2,6 @@
require 'json'
class LectureGraphQLApiTest < ActionDispatch::IntegrationTest
-
setup do
@conference = create :conference_with_recordings
end
@@ -20,7 +19,7 @@ class LectureGraphQLApiTest < ActionDispatch::IntegrationTest
thumbUrl
posterUrl
}
- timelens {
+ timelens {
timelineUrl
thumbnailsUrl
}
@@ -49,7 +48,6 @@ class LectureGraphQLApiTest < ActionDispatch::IntegrationTest
assert_nil result['errors']
end
-
test 'load newest conference' do
query_string = <<-GRAPHQL
query($id: ID!) {
@@ -68,7 +66,6 @@ class LectureGraphQLApiTest < ActionDispatch::IntegrationTest
@event = create :event
result = MediaBackendSchema.execute(query_string, variables: { id: @event.id })
assert_nil result['errors']
-
end
unless ENV['SKIP_ELASTICSEARCH']
@@ -124,5 +121,4 @@ class LectureGraphQLApiTest < ActionDispatch::IntegrationTest
assert_equal 1, result['data']['lectureSearch'].count
end
end
-
end
diff --git a/test/integration/graphql/schema_test.rb b/test/integration/graphql/schema_test.rb
index f976b37e..d9c8130e 100644
--- a/test/integration/graphql/schema_test.rb
+++ b/test/integration/graphql/schema_test.rb
@@ -1,7 +1,6 @@
require "test_helper"
class SchemaTest < ActiveSupport::TestCase
-
# disabled due to NoMethodError: undefined method `visible?' for nil:NilClass
#
# def test_printout_is_up_to_date
@@ -9,4 +8,4 @@ class SchemaTest < ActiveSupport::TestCase
# printout_defn = File.read(Rails.root.join("app/graphql/schema.graphql"))
# assert_equal(current_defn, printout_defn, "Update the printed schema with `bundle exec rake graphql:schema:dump`")
# end
-end
\ No newline at end of file
+end
diff --git a/test/lib/feeds/podcast_generator_test.rb b/test/lib/feeds/podcast_generator_test.rb
index c67059d8..30fffd83 100644
--- a/test/lib/feeds/podcast_generator_test.rb
+++ b/test/lib/feeds/podcast_generator_test.rb
@@ -2,13 +2,8 @@
module Feeds
class PodcastGeneratorTest < ActiveSupport::TestCase
- class ViewContext
- def event_url(*args)
- ""
- end
- end
test 'handles invalid recording.duration' do
- feed = PodcastGenerator.new(ViewContext.new, title: 'some-title', channel_summary: 'some-summary', logo_image: 'some-url')
+ feed = PodcastGenerator.new(title: 'some-title', channel_summary: 'some-summary', logo_image: 'some-url')
create_list(:event_with_recordings, 5)
Recording.update_all(length: nil)
diff --git a/test/lib/frontend/folder_tree_test.rb b/test/lib/frontend/folder_tree_test.rb
index 46ce80ab..cea1b550 100644
--- a/test/lib/frontend/folder_tree_test.rb
+++ b/test/lib/frontend/folder_tree_test.rb
@@ -20,7 +20,6 @@ class FolderTreeTest < ActiveSupport::TestCase
assert_includes paths, 'a'
assert_includes paths, 'h'
-
folders = tree.folders_at('a')
assert_equal 3, folders.length
@@ -29,7 +28,6 @@ class FolderTreeTest < ActiveSupport::TestCase
assert_includes paths, 'a/e'
assert_includes paths, 'a/g'
-
folders = tree.folders_at('a/b')
assert_equal 2, folders.length
diff --git a/test/models/admin_user_test.rb b/test/models/admin_user_test.rb
index c8b0a149..97fd1c6c 100644
--- a/test/models/admin_user_test.rb
+++ b/test/models/admin_user_test.rb
@@ -4,5 +4,5 @@ class AdminUserTest < ActiveSupport::TestCase
test "should create admin user" do
r = create :admin_user
assert r.valid?
- end
+ end
end
diff --git a/test/models/api_key_test.rb b/test/models/api_key_test.rb
index 1731084c..0984ccd7 100644
--- a/test/models/api_key_test.rb
+++ b/test/models/api_key_test.rb
@@ -5,5 +5,5 @@ class ApiKeyTest < ActiveSupport::TestCase
k = ApiKey.new description: "key1"
k.save!
assert_not_nil k.key
- end
+ end
end
diff --git a/test/models/event_test.rb b/test/models/event_test.rb
index eff43d4e..f64721e3 100644
--- a/test/models/event_test.rb
+++ b/test/models/event_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class EventTest < ActiveSupport::TestCase
-
setup do
@event = create(:event)
end
@@ -15,7 +14,7 @@ class EventTest < ActiveSupport::TestCase
test "should not save without a conference" do
@event.conference = nil
- assert_raises (ActiveRecord::RecordInvalid) { @event.save! }
+ assert_raises (ActiveRecord::RecordInvalid) { @event.save! }
end
test "should fill info from xml" do
@@ -79,7 +78,6 @@ class EventTest < ActiveSupport::TestCase
assert_equal event1.release_date, conference.event_last_released_at
-
# newer
event2 = create(:event_with_recordings)
event2.release_date = Time.new(2016, 01, 13)
@@ -88,7 +86,6 @@ class EventTest < ActiveSupport::TestCase
# now event2
assert_equal event2.release_date, conference.event_last_released_at
-
# older
event3 = create(:event_with_recordings)
event3.release_date = Time.new(2015, 03, 01)
@@ -161,7 +158,6 @@ class EventTest < ActiveSupport::TestCase
assert_equal event1.release_date, conference.event_last_released_at
end
-
test 'should not update event_last_released_at when unreleased event is added' do
conference = create(:conference)
assert_nil conference.event_last_released_at
@@ -185,7 +181,6 @@ class EventTest < ActiveSupport::TestCase
assert_nil conference.event_last_released_at
-
# normal event with rel
event2 = create(:event_with_recordings)
event2.release_date = Time.new(2016, 01, 13)
@@ -193,17 +188,14 @@ class EventTest < ActiveSupport::TestCase
assert_equal conference.event_last_released_at, event2.release_date
-
# unreleased event, maybe with relive recording
event3 = create(:event_with_recordings)
event3.release_date = nil
conference.events << event3
assert_equal conference.event_last_released_at, event2.release_date
-
end
-
test 'should trigger callback to update conferences event_last_released_at' do
assert @event.conference
assert_equal @event.conference.event_last_released_at, @event.release_date
diff --git a/test/models/frontend/event_test.rb b/test/models/frontend/event_test.rb
index 8574c11b..a6ec469a 100644
--- a/test/models/frontend/event_test.rb
+++ b/test/models/frontend/event_test.rb
@@ -1,7 +1,6 @@
require 'test_helper'
class EventTest < ActiveSupport::TestCase
-
setup do
@event = create(:event)
end
diff --git a/test/models/news_test.rb b/test/models/news_test.rb
index 6a6fec98..f7c74453 100644
--- a/test/models/news_test.rb
+++ b/test/models/news_test.rb
@@ -10,6 +10,6 @@ class NewsTest < ActiveSupport::TestCase
r = News.new
r.title = 'a'
r.body = 'b'
- assert_raises(ActiveRecord::RecordInvalid) { r.save! }
+ assert_raises(ActiveRecord::RecordInvalid) { r.save! }
end
end
diff --git a/test/test_helper.rb b/test/test_helper.rb
index b4c0c9b5..55a3892b 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -2,7 +2,6 @@
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/pride'
-require 'sidekiq/testing'
require 'tilt/redcarpet'
require 'rexml/document'
require 'sidekiq/testing'
diff --git a/test/workers/feed/folder_worker_test.rb b/test/workers/feed/folder_worker_test.rb
index 6c43f7f7..8bb91dc2 100644
--- a/test/workers/feed/folder_worker_test.rb
+++ b/test/workers/feed/folder_worker_test.rb
@@ -31,6 +31,7 @@ def test_perform_audio
end
f = WebFeed.find_by!(kind: @conference.acronym+'mp3', key: 'podcast_folder')
+ assert_includes f.content, "https://media.ccc.de/v/#{@conference.events.last.slug}"
refute_empty f.content
end
end