{"action":"published","release":{"url":"https://api.github.com/repos/palkan/action-cable-testing/releases/9911930","assets_url":"https://api.github.com/repos/palkan/action-cable-testing/releases/9911930/assets","upload_url":"https://uploads.github.com/repos/palkan/action-cable-testing/releases/9911930/assets{?name,label}","html_url":"https://github.com/palkan/action-cable-testing/releases/tag/v0.3.0","id":9911930,"tag_name":"v0.3.0","target_commitish":"master","name":"v0.3.0","draft":false,"author":{"login":"palkan","id":1516722,"avatar_url":"https://avatars2.githubusercontent.com/u/1516722?v=4","gravatar_id":"","url":"https://api.github.com/users/palkan","html_url":"https://github.com/palkan","followers_url":"https://api.github.com/users/palkan/followers","following_url":"https://api.github.com/users/palkan/following{/other_user}","gists_url":"https://api.github.com/users/palkan/gists{/gist_id}","starred_url":"https://api.github.com/users/palkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palkan/subscriptions","organizations_url":"https://api.github.com/users/palkan/orgs","repos_url":"https://api.github.com/users/palkan/repos","events_url":"https://api.github.com/users/palkan/events{/privacy}","received_events_url":"https://api.github.com/users/palkan/received_events","type":"User","site_admin":false},"prerelease":false,"created_at":"2018-03-02T13:48:32Z","published_at":"2018-03-02T13:56:04Z","assets":[],"tarball_url":"https://api.github.com/repos/palkan/action-cable-testing/tarball/v0.3.0","zipball_url":"https://api.github.com/repos/palkan/action-cable-testing/zipball/v0.3.0","body":"Added support for connection unit-testing.\r\n\r\n## Minitest Usage\r\n\r\n```ruby\r\nmodule ApplicationCable\r\n  class ConnectionTest < ActionCable::Connection::TestCase\r\n    def test_connects_with_cookies\r\n      # Simulate a connection\r\n      connect cookies: { user_id: users[:john].id }\r\n\r\n      # Asserts that the connection identifier is correct\r\n      assert_equal \"John\", connection.user.name\r\n  end\r\n\r\n  def test_does_not_connect_without_user\r\n    assert_reject_connection do\r\n      connect\r\n    end\r\n  end\r\nend\r\n```\r\n\r\nYou can also provide additional information about underlying HTTP request:\r\n\r\n```ruby\r\ndef test_connect_with_headers_and_query_string\r\n  connect \"/cable?user_id=1\", headers: { \"X-API-TOKEN\" => 'secret-my' }\r\n\r\n  assert_equal connection.user_id, \"1\"\r\nend\r\n```\r\n\r\n## RSpec usage\r\n\r\n```ruby\r\nrequire \"rails_helper\"\r\n\r\nRSpec.describe ApplicationCable::Connection, type: :channel do\r\n  it \"successfully connects\" do\r\n    connect \"/cable\", headers: { \"X-USER-ID\" => \"325\" }\r\n    expect(connection.user_id).to eq \"325\"\r\n  end\r\n\r\n  it \"rejects connection\" do\r\n    expect { connect \"/cable\" }.to have_rejected_connection\r\n  end\r\nend\r\n```\r\n\r\n"}}
{"actor":{"display_login":"palkan"}}