Skip to content

Commit

Permalink
Add generator tests
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Sep 16, 2024
1 parent 4dfbb69 commit d81ebe4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/lib/generators/solid_cable/install/install_generator_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require "test_helper"
require_relative "../../../../../lib/generators/solid_cable/install/install_generator"

class SolidCable::InstallGeneratorTest < Rails::Generators::TestCase
tests SolidCable::InstallGenerator
destination File.expand_path("../../../../../tmp", __dir__)

setup :prepare_destination
setup :run_generator

test "cable_schema exists" do
assert_file "db/cable_schema.rb"
end

test "cable.yml exists" do
assert_file "config/cable.yml"
end
end
14 changes: 14 additions & 0 deletions test/lib/generators/solid_cable/update/update_generator_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "test_helper"
require_relative "../../../../../lib/generators/solid_cable/update/update_generator"

class SolidCable::UpdateGeneratorTest < Rails::Generators::TestCase
tests SolidCable::UpdateGenerator
destination File.expand_path("../../../../../tmp", __dir__)

setup :prepare_destination
setup :run_generator

test "cable_schema exists" do
assert_migration "db/cable_migrate/create_compact_channel.rb"
end
end

0 comments on commit d81ebe4

Please sign in to comment.