Permalink
Browse files

added some missing specs

  • Loading branch information...
1 parent 0718a3a commit aa3fe53a11cf43ab86932228fc229b9616283379 @travishaynes committed May 25, 2012
Showing with 17 additions and 2 deletions.
  1. +1 −1 lib/shopify-routes.rb
  2. +15 −0 spec/lib/shopify-routes_spec.rb
  3. +1 −1 spec/support/rails_app.rb
@@ -172,7 +172,7 @@ def draw(r = @router)
if include?(:admin)
# route to a shop's admin path
r.match "*shop/admin" => r.redirect { |p,r|
- "https://#{shop_domain[:shop]}/admin"
+ "https://#{shop_domain(p[:shop])}/admin"
},
as: "admin"
end
@@ -25,6 +25,21 @@ def path_for(resource, id = nil)
describe "redirect routes" do
+ describe "brochure" do
+ subject { redirect_for "brochure" }
+ it { should eq "http://www.shopify.com?ref=referrer" }
+ end
+
+ describe "signup" do
+ subject { redirect_for "signup" }
+ it { should eq "https://app.shopify.com/services/signup?ref=referrer" }
+ end
+
+ describe "admin" do
+ subject { redirect_for "admin" }
+ it { should eq "https://#{@domain}/admin" }
+ end
+
describe "applications" do
subject { redirect_for "applications" }
it { should eq path_for "applications" }
@@ -17,5 +17,5 @@ class Application < Rails::Application
RailsApp::Application.initialize!
RailsApp::Application.routes.draw do
- ShopifyAPI.routes(self)
+ ShopifyAPI.routes self, :referrer => 'referrer'
end

0 comments on commit aa3fe53

Please sign in to comment.