diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eaf4fa8..6d0cd50 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,23 @@ $ bundle install --path vendor/bundle ### Run tests ```shell -$ STREAM_KEY=my_api_key STREAM_SECRET=my_api_secret bundle exec rake spec +$ STREAM_KEY=my_api_key STREAM_SECRET=my_api_secret bundle exec rspec spec +``` + +### Run specific test + +Add :focus tag on target test: + +```rb +it 'can mark messages as read', :focus do + # test something +end +``` + +And then run as following: + +```shell +$ STREAM_KEY=myapi_key STREAM_SECRET=my_secret STREAM_CHAT_URL=http://127.0.0.1:3030 bundle exec rspec spec --tag focus ``` ### Linters and type check diff --git a/lib/stream-chat/channel.rb b/lib/stream-chat/channel.rb index 91fb102..3a51ffd 100644 --- a/lib/stream-chat/channel.rb +++ b/lib/stream-chat/channel.rb @@ -219,7 +219,7 @@ def demote_moderators(user_ids) end # Sends the mark read event for this user, only works if the `read_events` setting is enabled. - sig { params(user_id: String, options: StringKeyHash).returns(StreamChat::StreamResponse) } + sig { params(user_id: String, options: T.untyped).returns(StreamChat::StreamResponse) } def mark_read(user_id, **options) payload = add_user_id(options, user_id) @client.post("#{url}/read", data: payload) diff --git a/spec/client_spec.rb b/spec/client_spec.rb index 41a68f1..ddd0cce 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -435,7 +435,7 @@ def loop_times(times) it 'offset with next should fail' do expect do - @client.search({ members: { '$in' => ['legolas'] } }, SecureRandom.uuid, offset: 2, next: SecureRandom.uuid) + @client.search({ members: { '$in' => ['legolas'] } }, SecureRandom.uuid, offset: 2, next: SecureRandom.uuid) end.to raise_error(/cannot use offset with next or sort parameters/) end