Adjust response results in list controller tests

This commit is contained in:
Andreas Nedbal 2022-07-09 19:05:35 +02:00 committed by Karina Kwiatek
parent a5b6ef07d3
commit 0555279cd2
1 changed files with 8 additions and 31 deletions

View File

@ -40,7 +40,7 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
let(:expected_response) do
{
"success" => false,
"status" => "toolong",
"status" => "parameter_error",
"message" => anything
}
end
@ -57,7 +57,7 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
let(:expected_response) do
{
"success" => false,
"status" => "notfound",
"status" => "not_found",
"message" => anything
}
end
@ -74,7 +74,7 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
let(:expected_response) do
{
"success" => false,
"status" => "toolong",
"status" => "err",
"message" => anything
}
end
@ -91,7 +91,7 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
let(:expected_response) do
{
"success" => false,
"status" => "exists",
"status" => "err",
"message" => anything
}
end
@ -117,15 +117,7 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
end
context "when user is not signed in" do
let(:expected_response) do
{
"success" => false,
"status" => "noauth",
"message" => anything
}
end
include_examples "returns the expected response"
it_behaves_like "requires login"
end
end
@ -212,15 +204,7 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
end
context "when user is not signed in" do
let(:expected_response) do
{
"success" => false,
"status" => "noauth",
"message" => anything
}
end
include_examples "returns the expected response"
it_behaves_like "requires login"
end
end
@ -302,7 +286,7 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
let(:expected_response) do
{
"success" => false,
"status" => "notfound",
"status" => "not_found",
"message" => anything
}
end
@ -359,15 +343,8 @@ describe Ajax::ListController, :ajax_controller, type: :controller do
context "when user is not signed in" do
let(:add_param) { "whatever" }
let(:expected_response) do
{
"success" => false,
"status" => "noauth",
"message" => anything
}
end
include_examples "returns the expected response"
it_behaves_like "requires login"
end
end
end