You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generator creates wrong variable in request url , example:
describe"GET /show"doit"renders a successful response"douser=Accounts::User.create!valid_attributesgetaccounts_user_url(accounts_user),as: :jsonexpect(response).tobe_successfulendend
Expected behaviour
Same variable name when create spec data and request url
OPTION 1
describe"GET /show"doit"renders a successful response"douser=Accounts::User.create!valid_attributesgetaccounts_user_url(user),as: :jsonexpect(response).tobe_successfulendend
or
OPTION 2
describe"GET /show"doit"renders a successful response"doaccounts_user=Accounts::User.create!valid_attributesgetaccounts_user_url(accounts_user),as: :jsonexpect(response).tobe_successfulendend
Solution
The main problem is the method show_helper uses table_names to build request url, while the spec variable data uses file_name
I recon the first option is better to keep the pattern of another templates and i would like to create a PR to this fix
The text was updated successfully, but these errors were encountered:
What Ruby, Rails and RSpec versions are you using?
Ruby version: 2.7.2
Rails version: 6.1.3.1
RSpec-core version: 3.10.1
Rspec-rails version: 5.0.1
Rails API
Observed behaviour
When is generated a namespace model with scaffold
The generator creates wrong variable in request url , example:
Expected behaviour
Same variable name when create spec data and request url
OPTION 1
or
OPTION 2
Solution
The main problem is the method show_helper uses table_names to build request url, while the spec variable data uses file_name
I recon the first option is better to keep the pattern of another templates and i would like to create a PR to this fix
The text was updated successfully, but these errors were encountered: