Skip to content

Instantly share code, notes, and snippets.

@igkuz
Last active December 17, 2015 14:39
Show Gist options
  • Save igkuz/5626187 to your computer and use it in GitHub Desktop.
Save igkuz/5626187 to your computer and use it in GitHub Desktop.
describe "Channels Api Controller" do
it "should get all channels from api" do
stub_requested = stub_request(:get, channels_api_url).
with(body: { credentials: credentials }).
to_return(status: 200, body: load_fixture('channels.json'), headers: {})
channels_api_controller = app.controller('api/channels_controller')
channels_api_controller.all_channels.on_complete do |models|
@models = models
end
run_requests
expect(@models.first)to be_instance_of(Channel)
assert_requested stub_requested
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment