Remove duplication of params in tests.

This commit is contained in:
Guo Xiang Tan 2018-03-02 09:25:46 +08:00
parent 75172024ca
commit 5c93d07d2a
2 changed files with 1 additions and 3 deletions

View File

@ -22,7 +22,6 @@ RSpec.describe PostsController do
category.set_permissions(staff: :full)
category.save!
# strange API, why is topic id in here twice
put "/posts/#{post.id}.json", params: {
post: { category_id: category.id, raw: "this is a test edit to post" }
}

View File

@ -14,8 +14,7 @@ RSpec.describe TopicsController do
category.set_permissions(staff: :full)
category.save!
# strange API, why is topic id in here twice
put "/t/#{post.topic_id}.json", params: { category_id: category.id, topic_id: post.topic_id }
put "/t/#{post.topic_id}.json", params: { category_id: category.id }
expect(response.status).not_to eq(200)
expect(post.topic.category_id).not_to eq(category.id)