-
-
Save igkuz/5626187 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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