Sha256: 5e4da25977d0b80f5e3c1bf3c0333efc6132ce07a17cc4a5c4e2e44d6c866c77
Contents?: true
Size: 821 Bytes
Versions: 34
Compression:
Stored size: 821 Bytes
Contents
require 'spec_helper' describe Localeapp::KeyChecker, "#check(key)" do it "returns false and an empty hash if the response from locale app is a 404" do FakeWeb.register_uri(:get, 'https://api.localeapp.com/v1/projects/TEST_KEY.json', :body => "", :status => ['404', 'Not Found']) with_configuration do @checker = Localeapp::KeyChecker.new end @checker.check('TEST_KEY').should == [false, {}] end it "returns true and and the parsed json hash if the response from locale app is a 200" do FakeWeb.register_uri(:get, 'https://api.localeapp.com/v1/projects/TEST_KEY.json', :body => valid_project_data.to_json, :status => ['200', 'OK']) with_configuration do @checker = Localeapp::KeyChecker.new end @checker.check('TEST_KEY').should == [true, valid_project_data] end end
Version data entries
34 entries across 34 versions & 1 rubygems