diff --git a/spec/tasks/gen/action_spec.cr b/spec/tasks/gen/action_spec.cr index 5ea0c7d7f..3b6c45cbd 100644 --- a/spec/tasks/gen/action_spec.cr +++ b/spec/tasks/gen/action_spec.cr @@ -106,4 +106,15 @@ describe Gen::Action do io.to_s.should contain("That's not a valid Action.") end end + + it "generates the correct template" do + template = Lucky::ActionTemplate.new( + name: "User::Index", + action: "index", + inherit_from: "BrowserAction", + route: %(get "/users") + ) + folder = template.template_folder + LuckyTemplate.snapshot(folder).has_key?("src/actions/user/index.cr").should eq(true) + end end diff --git a/tasks/gen/action/action_generator.cr b/tasks/gen/action/action_generator.cr index 2684b9818..87a3ff449 100644 --- a/tasks/gen/action/action_generator.cr +++ b/tasks/gen/action/action_generator.cr @@ -1,3 +1,4 @@ +require "ecr" require "colorize" require "lucky_template" require "../../../src/lucky/route_inferrer" diff --git a/tasks/gen/component.cr b/tasks/gen/component.cr index 51751d596..87aac881a 100644 --- a/tasks/gen/component.cr +++ b/tasks/gen/component.cr @@ -1,3 +1,4 @@ +require "ecr" require "lucky_task" require "lucky_template" require "colorize" diff --git a/tasks/gen/page.cr b/tasks/gen/page.cr index c88144cf7..16bc1daf5 100644 --- a/tasks/gen/page.cr +++ b/tasks/gen/page.cr @@ -1,3 +1,4 @@ +require "ecr" require "lucky_task" require "lucky_template" require "colorize" diff --git a/tasks/gen/task.cr b/tasks/gen/task.cr index 41bed39ad..12419cd5d 100644 --- a/tasks/gen/task.cr +++ b/tasks/gen/task.cr @@ -1,3 +1,4 @@ +require "ecr" require "lucky_task" require "lucky_template" require "colorize"