Skip to content

Commit 7ea0f51

Browse files
fix: sorbet type for mark_read function signature (#130)
1 parent 09eabb3 commit 7ea0f51

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,23 @@ $ bundle install --path vendor/bundle
1414
### Run tests
1515

1616
```shell
17-
$ STREAM_KEY=my_api_key STREAM_SECRET=my_api_secret bundle exec rake spec
17+
$ STREAM_KEY=my_api_key STREAM_SECRET=my_api_secret bundle exec rspec spec
18+
```
19+
20+
### Run specific test
21+
22+
Add :focus tag on target test:
23+
24+
```rb
25+
it 'can mark messages as read', :focus do
26+
# test something
27+
end
28+
```
29+
30+
And then run as following:
31+
32+
```shell
33+
$ STREAM_KEY=myapi_key STREAM_SECRET=my_secret STREAM_CHAT_URL=http://127.0.0.1:3030 bundle exec rspec spec --tag focus
1834
```
1935

2036
### Linters and type check

lib/stream-chat/channel.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def demote_moderators(user_ids)
219219
end
220220

221221
# Sends the mark read event for this user, only works if the `read_events` setting is enabled.
222-
sig { params(user_id: String, options: StringKeyHash).returns(StreamChat::StreamResponse) }
222+
sig { params(user_id: String, options: T.untyped).returns(StreamChat::StreamResponse) }
223223
def mark_read(user_id, **options)
224224
payload = add_user_id(options, user_id)
225225
@client.post("#{url}/read", data: payload)

spec/client_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def loop_times(times)
435435

436436
it 'offset with next should fail' do
437437
expect do
438-
@client.search({ members: { '$in' => ['legolas'] } }, SecureRandom.uuid, offset: 2, next: SecureRandom.uuid)
438+
@client.search({ members: { '$in' => ['legolas'] } }, SecureRandom.uuid, offset: 2, next: SecureRandom.uuid)
439439
end.to raise_error(/cannot use offset with next or sort parameters/)
440440
end
441441

0 commit comments

Comments
 (0)