Sha256: f1547debbadb3dc257f74b58ae8008607bfd4f3ebe6cdbfbd2084a44fbf80240
Contents?: true
Size: 819 Bytes
Versions: 5
Compression:
Stored size: 819 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, 'http://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, 'http://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
5 entries across 5 versions & 1 rubygems