Test::Unit::TestCase
# File tests/drivers/mock/instance_states_test.rb, line 24 def app Sinatra::Application end
# File tests/drivers/mock/instance_states_test.rb, line 37 def test_each_state_has_transition get_auth_url '/api/instance_states', {} (last_xml_response/'states/state').each do |state| next if state['name'].eql?('finish') # Finnish state doesn't have transitions (state/'transition').length.should > 0 (state/'transition').each do |transition| transition['to'].should_not == nil end end end
# File tests/drivers/mock/realms_test.rb, line 37 def test_it_has_correct_attributes_set get_auth_url '/api/realms', {} (last_xml_response/'realms/realm').each do |realm| realm.attributes.keys.sort.should == [ 'href', 'id' ] end end
# File tests/drivers/mock/realms_test.rb, line 56 def test_it_has_unique_ids get_auth_url '/api/realms', {} ids = [] (last_xml_response/'realms/realm').each do |realm| ids << realm['id'].to_s end ids.sort.should == ids.sort.uniq end
# File tests/drivers/mock/instance_states_test.rb, line 28 def test_it_not_require_authentication require_authentication?('/api/realms').should_not == true end
# File tests/drivers/mock/instance_states_test.rb, line 58 def test_it_responses_to_html get_url '/api/instance_states', {}, { :format => :html } last_response.status.should == 200 Nokogiri::HTML(last_response.body).search('html').first.name.should == 'html' end
# File tests/drivers/mock/instance_states_test.rb, line 48 def test_it_responses_to_json # FIXME: This test is suffering from conflict between JSON gem and Activesupport # gem in EC2. # #do_request '/api/instance_states', {}, false, { :format => :json } #JSON::parse(last_response.body).class.should == Array #JSON::parse(last_response.body).first['transitions'].class.should == Array #JSON::parse(last_response.body).first['name'].should == 'start' end
# File tests/drivers/mock/instance_states_test.rb, line 64 def test_it_responses_to_png get_url '/api/instance_states', { :format => 'png' } last_response.status.should == 200 last_response.headers['Content-Type'].should =~ /^image\/png/ end
# File tests/drivers/mock/instance_states_test.rb, line 32 def test_it_returns_instance_states get_auth_url '/api/instance_states', {} (last_xml_response/'states/state').length.should > 0 end
# File tests/drivers/mock/realms_test.rb, line 32 def test_it_returns_realms get_auth_url '/api/realms', {} (last_xml_response/'realms/realm').length.should > 0 end
Generated with the Darkfish Rdoc Generator 2.