Skip to content
Merged
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 app/models/track.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Track < ApplicationRecord
# A list here rather than a lookup of the published manifest, because
# isolating a page is a deliberate per-track decision, not a side effect of
# something landing in S3.
CLIENT_SIDE_TEST_RUNNER_SLUGS = %w[jq].freeze
CLIENT_SIDE_TEST_RUNNER_SLUGS = %w[jq cpp].freeze
def client_side_test_runner? = CLIENT_SIDE_TEST_RUNNER_SLUGS.include?(slug)

delegate :about, :snippet,
Expand Down
5 changes: 5 additions & 0 deletions test/models/track_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class TrackTest < ActiveSupport::TestCase
assert_equal track.slug, track.to_param
end

test "client_side_test_runner?" do
assert create(:track, slug: "cpp").client_side_test_runner?
refute create(:track, slug: "ruby").client_side_test_runner?
end

test "highlightjs_language uses slug if nil" do
track = create :track, highlightjs_language: nil
assert_equal 'ruby', track.highlightjs_language
Expand Down
Loading