Skip to content

Commit

Permalink
Test: main GBL Admin module
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Dec 3, 2024
1 parent 32fa99b commit fec333c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion app/models/geoblacklight_admin.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# frozen_string_literal: true

module GeoblacklightAdmin
include GeoblacklightAdmin::IsoLanguageCodes
end
18 changes: 13 additions & 5 deletions test/models/geoblacklight_admin_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
require "test_helper"

class GeoblacklightAdminTest < ActiveSupport::TestCase
test "should respond to language_name method from IsoLanguageCodes" do
assert_equal "English", GeoblacklightAdmin::IsoLanguageCodes.call["eng"]
assert_equal "French", GeoblacklightAdmin::IsoLanguageCodes.call["fra"]
assert_nil GeoblacklightAdmin::IsoLanguageCodes.call["de"]
setup do
@dummy_class = Class.new do
include GeoblacklightAdmin
end
end
end

def test_module_defined
assert defined?(GeoblacklightAdmin), "GeoblacklightAdmin module should be defined"
end

def test_module_inclusion
assert_includes @dummy_class.included_modules, GeoblacklightAdmin, "GeoblacklightAdmin should be included in DummyClass"
end
end

0 comments on commit fec333c

Please sign in to comment.