Add the remaining necessary parameters to the test

This commit is contained in:
Jyri-Petteri Paloposki 2020-09-06 02:44:35 +03:00
parent e3b064638c
commit beed8773e6

View file

@ -230,13 +230,31 @@ class TodosControllerTest < ActionController::TestCase
"description" => "Call Warren Buffet to find out how much he makes per day",
"due" => "30/11/2006"
},
"_source_view" => "context",
"tag_list" => "foo bar"
}
assert_response 200
end
end
def test_create_todo_via_xhr_context_view
login_as(:admin_user)
assert_difference 'Todo.count' do
put :create, xhr: true, params: {
"context_name" => "library",
"project_name" => "",
"todo" => {
"notes" => "",
"description" => "Read Warren Buffet's book",
"due" => "30/12/2006"
},
"_source_view" => "context",
"default_context_name" => "library",
"tag_list" => "bar foo"
}
assert_response 200
end
end
def test_fail_to_create_todo_via_xml
login_as(:admin_user)
# try to create with no context, which is not valid