Skip to content

Commit

Permalink
Add test for calling show
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeslayer committed Mar 16, 2016
1 parent e1904d6 commit 549beb4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/snapshot_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,13 @@ def test_snapshot_create
# result = snapshot.update!(name: 'kitten2')
# assert_equal result.Name, 'kitten2'
# end

def test_snapshot_show
stub_request(:get, 'http://localhost/api/snapshots/kitten')
.to_return(body: '{"Name":"kitten","CreatedAt":"2015-02-27T21:36:08.337443295+03:00","Description":"Snapshot from mirror [wheezy-main]: http://mirror.yandex.ru/debian/ wheezy"}')

snapshot = ::Aptly::Snapshot.new(::Aptly::Connection.new, Name: 'kitten')
snapshot.show
assert_requested(:get, 'http://localhost/api/snapshots/kitten')
end
end

0 comments on commit 549beb4

Please sign in to comment.