Skip to content

Commit

Permalink
add smoochBotAddSlackChannelUrl test back
Browse files Browse the repository at this point in the history
  • Loading branch information
vasconsaurus committed Jan 3, 2024
1 parent 5627bbf commit 2446ad8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/controllers/graphql_controller_8_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,20 @@ def setup
assert_equal [pm.id], JSON.parse(@response.body)['data']['search']['medias']['edges'].collect{ |x| x['node']['dbid'] }
end

test "should check permission before setting Slack channel URL" do
u = create_user
t = create_team
create_team_user team: t, user: u, role: 'admin'
p = create_project team: t
d = create_dynamic_annotation annotated: p, annotation_type: 'smooch_user'
u2 = create_user
authenticate_with_user(u2)
query = 'mutation { smoochBotAddSlackChannelUrl(input: { clientMutationId: "1", id: "' + d.id.to_s +
'", set_fields: "{\"smooch_user_slack_channel_url\":\"' + random_url+ '\"}" }) { annotation { dbid } } }'
post :create, params: { query: query }
assert_response 400
end

test "should delete tag" do
u = create_user
t = create_team
Expand Down

0 comments on commit 2446ad8

Please sign in to comment.