Skip to content

Business intelligence made simple

Improved tests [skip ci]

Andrew Kane41f8df223ac3
diff --git a/test/permissions_test.rb b/test/permissions_test.rb
index 59b7389a..d1f34ff7 100644
--- a/test/permissions_test.rb
+++ b/test/permissions_test.rb
@@ -28,7 +28,7 @@ class PermissionsTest < ActionDispatch::IntegrationTest
end
with_new_user do
- patch blazer.query_path(query), params: {name: "Renamed"}
+ patch blazer.query_path(query), params: {query: {name: "Renamed"}}
assert_response :unprocessable_entity
assert_match "Sorry, permission denied", response.body
@@ -39,6 +39,18 @@ class PermissionsTest < ActionDispatch::IntegrationTest
end
end
+ def test_change_creator
+ with_new_user do |user|
+ query = create_query(name: "Test", creator: user)
+
+ patch blazer.query_path(query), params: {query: {name: "* Test"}}
+ assert_response :redirect
+
+ patch blazer.query_path(query), params: {query: {name: "# Test"}}
+ assert_response :redirect
+ end
+ end
+
private
def with_new_user