diff --git a/spec/controllers/ajax/list_controller_spec.rb b/spec/controllers/ajax/list_controller_spec.rb index 05086587..d14939ce 100644 --- a/spec/controllers/ajax/list_controller_spec.rb +++ b/spec/controllers/ajax/list_controller_spec.rb @@ -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