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