Add some missing tests
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
require "test_helper"
|
||||
|
||||
class Bubbles::EngagementsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in_as :kevin
|
||||
end
|
||||
|
||||
test "create" do
|
||||
bubble = bubbles(:shipping)
|
||||
|
||||
assert_changes -> { bubble.reload.doing? }, from: false, to: true do
|
||||
post bucket_bubble_engagement_url(bubble.bucket, bubble)
|
||||
end
|
||||
|
||||
assert_redirected_to bucket_bubble_url(bubble.bucket, bubble)
|
||||
end
|
||||
|
||||
test "destroy" do
|
||||
bubble = bubbles(:logo)
|
||||
|
||||
assert_changes -> { bubble.reload.doing? }, from: true, to: false do
|
||||
delete bucket_bubble_engagement_url(bubble.bucket, bubble)
|
||||
end
|
||||
|
||||
assert_redirected_to bucket_bubble_url(bubble.bucket, bubble)
|
||||
end
|
||||
end
|
||||
@@ -131,4 +131,12 @@ class FilterTest < ActiveSupport::TestCase
|
||||
expected = { indexed_by: "most_discussed", assignee_ids: [ users(:jz).id, users(:kevin).id ] }
|
||||
assert_equal expected, filter.as_params_without(:assignee_ids, users(:david).id).to_h
|
||||
end
|
||||
|
||||
test "get a clone with some changed params" do
|
||||
seed_filter = users(:david).filters.new indexed_by: "active", terms: [ "haggis" ]
|
||||
filter = seed_filter.with(indexed_by: "popped")
|
||||
|
||||
assert filter.indexed_by.popped?
|
||||
assert_equal ["haggis"], filter.terms
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user