Skip to content

Commit

Permalink
fix: loco generate reqeust test template use pkg_name
Browse files Browse the repository at this point in the history
  • Loading branch information
fan-tastic-z committed Dec 12, 2023
1 parent caa51f2 commit 6fe73d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn generate<H: Hooks>(component: Component) -> Result<()> {
println!("{}", scaffold::generate::<H>(&rrgen, &name, &fields)?);
}
Component::Controller { name } => {
let vars = json!({ "name": name });
let vars = json!({ "name": name, "pkg_name": H::app_name()});
rrgen.generate(CONTROLLER_T, &vars)?;
rrgen.generate(CONTROLLER_TEST_T, &vars)?;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gen/templates/request_test.t
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ injections:
append: true
content: "pub mod {{ file_name }};"
---
use blo::app::App;
use {{pkg_name}}::app::App;
use migration::Migrator;
use loco_rs::testing;
use serial_test::serial;
Expand Down

0 comments on commit 6fe73d4

Please sign in to comment.