Commit d03d0d7b authored by gaga5lala's avatar gaga5lala

REFACTOR: fix code review comments2

- rspec rewording
- argument type
parent 09ba3e45
...@@ -43,7 +43,7 @@ module API ...@@ -43,7 +43,7 @@ module API
optional :action, String, values: Todo::ACTION_NAMES.values.map(&:to_s) optional :action, String, values: Todo::ACTION_NAMES.values.map(&:to_s)
optional :author_id, Integer optional :author_id, Integer
optional :state, String, values: Todo.state_machine.states.map(&:name).map(&:to_s) optional :state, String, values: Todo.state_machine.states.map(&:name).map(&:to_s)
optional :type, Array[String], values: TodosFinder.todo_types optional :type, String, values: TodosFinder.todo_types
optional :project_id, Integer optional :project_id, Integer
optional :group_id, Integer optional :group_id, Integer
end end
......
...@@ -43,14 +43,14 @@ RSpec.describe API::Todos do ...@@ -43,14 +43,14 @@ RSpec.describe API::Todos do
end end
context "invalid state" do context "invalid state" do
it 'returns argument error' do it 'returns 400' do
get api('/todos', john_doe), params: { state: 'InvalidState' } get api('/todos', john_doe), params: { state: 'InvalidState' }
expect(response).to have_gitlab_http_status(:bad_request) expect(response).to have_gitlab_http_status(:bad_request)
end end
end end
context "invalid type" do context "invalid type" do
it 'returns argument error' do it 'returns 400' do
get api('/todos', john_doe), params: { type: 'InvalidType' } get api('/todos', john_doe), params: { type: 'InvalidType' }
expect(response).to have_gitlab_http_status(:bad_request) expect(response).to have_gitlab_http_status(:bad_request)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment