spec/localeapp/routes_spec.rb in localeapp-0.1.2 vs spec/localeapp/routes_spec.rb in localeapp-0.2.0
- old
+ new
@@ -19,33 +19,33 @@
end
end
end
describe '#project_url' do
- it "is constructed from the configuration host and port and defaults to json" do
- with_configuration(@config.merge(:port => 1234)) do
+ it "is constructed from the configuration host, port and secure and defaults to json" do
+ with_configuration(@config.merge(:port => 1234, :secure => false)) do
@routes.project_url.should == "http://test.host:1234/v1/projects/API_KEY.json"
end
end
it "includes http auth if in configuration" do
with_configuration(@config.merge(:port => 1234, :http_auth_username => 'foo', :http_auth_password => 'bar')) do
- @routes.project_url.should == "http://foo:bar@test.host:1234/v1/projects/API_KEY.json"
+ @routes.project_url.should == "https://foo:bar@test.host:1234/v1/projects/API_KEY.json"
end
end
it "can be changed to another content type" do
with_configuration(@config) do
- @routes.project_url(:format => :yml).should == 'http://test.host/v1/projects/API_KEY.yml'
+ @routes.project_url(:format => :yml).should == 'https://test.host/v1/projects/API_KEY.yml'
end
end
end
describe "#translations_url" do
it "it extends the project_url and defaults to json" do
with_configuration(@config) do
- @routes.translations_url.should == "http://test.host/v1/projects/API_KEY/translations.json"
+ @routes.translations_url.should == "https://test.host/v1/projects/API_KEY/translations.json"
end
end
it "adds query parameters on to the url" do
with_configuration(@config) do
@@ -55,11 +55,11 @@
end
end
it "can be changed to another content type" do
with_configuration(@config) do
- @routes.translations_url(:format => :yml).should == 'http://test.host/v1/projects/API_KEY/translations.yml'
+ @routes.translations_url(:format => :yml).should == 'https://test.host/v1/projects/API_KEY/translations.yml'
end
end
end
describe "#translations_endpoint(options = {})" do
@@ -93,11 +93,11 @@
end
describe "#missing_translations_url" do
it "it extends the project_url and defaults to json" do
with_configuration(@config) do
- @routes.missing_translations_url.should == "http://test.host/v1/projects/API_KEY/translations/missing.json"
+ @routes.missing_translations_url.should == "https://test.host/v1/projects/API_KEY/translations/missing.json"
end
end
it "adds query parameters on to the url" do
with_configuration(@config) do
@@ -107,18 +107,18 @@
end
end
it "can be changed to another content type" do
with_configuration(@config) do
- @routes.missing_translations_url(:format => :yml).should == 'http://test.host/v1/projects/API_KEY/translations/missing.yml'
+ @routes.missing_translations_url(:format => :yml).should == 'https://test.host/v1/projects/API_KEY/translations/missing.yml'
end
end
end
describe "#import_url" do
it "appends 'import to the project url" do
with_configuration(@config) do
- @routes.import_url.should == 'http://test.host/v1/projects/API_KEY/import/'
+ @routes.import_url.should == 'https://test.host/v1/projects/API_KEY/import/'
end
end
end
describe "#import_endpoint(options = {})" do