Skip to content

Commit

Permalink
Improved test code
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 7, 2023
1 parent b10a80d commit f88b266
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/activerecord_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ class ActiverecordGeneratorTest < Rails::Generators::TestCase
destination File.expand_path("../tmp", __dir__)
setup :prepare_destination

def test_works
def setup
skip if ENV["ADAPTER"] == "mongoid"
super
end

def test_works
run_generator
assert_file "config/initializers/ahoy.rb", /DatabaseStore/
assert_file "app/models/ahoy/visit.rb", /Ahoy::Visit < ApplicationRecord/
Expand All @@ -18,8 +21,6 @@ def test_works
end

def test_primary_key_type
skip if ENV["ADAPTER"] == "mongoid"

Rails.configuration.generators.stub(:options, {active_record: {primary_key_type: :uuid}}) do
run_generator
end
Expand Down

0 comments on commit f88b266

Please sign in to comment.