Use Rails 5.1 conventions in tests params
This commit is contained in:
@@ -138,9 +138,6 @@ Rails/HasAndBelongsToMany:
|
||||
Rails/HasManyOrHasOneDependent:
|
||||
Enabled: true
|
||||
|
||||
Rails/HttpPositionalArguments:
|
||||
Enabled: true
|
||||
|
||||
Rails/InverseOf:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -53,6 +53,9 @@ Rails/ApplicationJob:
|
||||
Rails/ApplicationRecord:
|
||||
Enabled: true
|
||||
|
||||
Rails/HttpPositionalArguments:
|
||||
Enabled: true
|
||||
|
||||
RSpec/NotToNot:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ describe DebatesController do
|
||||
}
|
||||
sign_in create(:user)
|
||||
|
||||
post :create, debate: debate_attributes
|
||||
post :create, params: { debate: debate_attributes }
|
||||
expect(Ahoy::Event.where(name: :debate_created).count).to eq 1
|
||||
expect(Ahoy::Event.last.properties["debate_id"]).to eq Debate.last.id
|
||||
end
|
||||
|
||||
@@ -18,7 +18,7 @@ describe RemoteTranslationsController do
|
||||
end
|
||||
|
||||
it "create correctly remote translation" do
|
||||
post :create, remote_translations: @remote_translations_params
|
||||
post :create, params: { remote_translations: @remote_translations_params }
|
||||
|
||||
expect(RemoteTranslation.count).to eq(1)
|
||||
end
|
||||
@@ -26,7 +26,7 @@ describe RemoteTranslationsController do
|
||||
it "create remote translation when same remote translation with error_message is enqueued" do
|
||||
create(:remote_translation, remote_translatable: debate, locale: :es, error_message: "Has errors")
|
||||
|
||||
post :create, remote_translations: @remote_translations_params
|
||||
post :create, params: { remote_translations: @remote_translations_params }
|
||||
|
||||
expect(RemoteTranslation.count).to eq(2)
|
||||
end
|
||||
@@ -34,13 +34,13 @@ describe RemoteTranslationsController do
|
||||
it "not create remote translation when same remote translation is enqueued" do
|
||||
create(:remote_translation, remote_translatable: debate, locale: :es)
|
||||
|
||||
post :create, remote_translations: @remote_translations_params
|
||||
post :create, params: { remote_translations: @remote_translations_params }
|
||||
|
||||
expect(RemoteTranslation.count).to eq(1)
|
||||
end
|
||||
|
||||
it "redirect_to request referer after create" do
|
||||
post :create, remote_translations: @remote_translations_params
|
||||
post :create, params: { remote_translations: @remote_translations_params }
|
||||
|
||||
expect(subject).to redirect_to("any_path")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user