Sha256: e1f052c9845de2cd5faf17c1c0ed5bf0d8b376bf9f90d9774c90b201c7e8a8d5
Contents?: true
Size: 1.01 KB
Versions: 4
Compression:
Stored size: 1.01 KB
Contents
require 'rubygems' require 'require_relative' if RUBY_VERSION < '1.9' require_relative File.join('..', 'common.rb') describe Deltacloud::Collections::InstanceStates do before do def app; run_frontend; end authorize 'mockuser', 'mockpassword' @collection = Deltacloud::Collections.collection(:instance_states) end it 'has index operation' do @collection.operation(:index).must_equal Sinatra::Rabbit::InstanceStatesCollection::IndexOperation end it 'returns list of states for current driver in various formats with index operation' do get root_url + '/instance_states' status.must_equal 200 xml.root.name.must_equal 'states' header 'Accept', 'application/json' get root_url + '/instance_states' status.must_equal 200 JSON::parse(response_body).must_be_kind_of Array JSON::parse(response_body).wont_be_empty header 'Accept', 'image/png' get root_url + '/instance_states' status.must_equal 200 last_response.content_type.must_equal 'image/png' end end
Version data entries
4 entries across 4 versions & 1 rubygems