This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.0' | |
# Use sqlite3 as the database for Active Record | |
gem 'sqlite3' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Spree::Api::OrdersController do | |
# This is required for Rspec route_to to work! | |
routes { Spree::Core::Engine.routes } | |
describe "GET /api/orders/mine" do | |
it "should route" do | |
expect(:get => "/api/orders/mine").to route_to( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Spree::Api::OrdersController do | |
routes { Spree::Core::Engine.routes } | |
describe "PUT /api/orders/:id/apply_coupon" do | |
it "should route" do | |
expect(:put => "/api/orders/123/apply_coupon_code?coupon_code=X").to route_to( | |
controller: 'spree/api/orders', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe Spree::Api::OrdersController do | |
render_views | |
let(:user) { create(:user) } | |
before(:each) do | |
warden = double(:warden, user: user, authenticate: user) | |
controller.stub(:env).and_return({'warden' => warden}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Core::Engine.routes.draw do | |
namespace :api, defaults: { format: 'json' } do | |
resources :orders do | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
module Bonobos | |
COLORS = ["brown", "khaki", "olive", "almond", "arizona wash", "ayr", "biscuit", "black", "black ink", "blueberry", "bubble gum", "charcoal", "collage", "cosmic rocks wash", "cosmos", "dove wings", "fade", "geranium", "grey", "heather grey", "ice wash", "jac's jean", "jac's jean with destroy", "la brea tar pits", "little fishes", "look stripe", "marine", "melon", "navy", "nightshade", "poppy", "snow", "stripe", "teacup", "unicorn", "water ice", "wave wash", "white"] | |
WAISTS = ["24", "25", "26", "27", "28", "30", "31", "29", "32", "34", "36", "38", "40"] | |
LENGTHS = ["32", "34", "25", "27", "28", "29", "30"] | |
NUMBER_OF_VARIANTS = 131 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.0' | |
gem 'pg' | |
# Use SCSS for stylesheets | |
gem 'sass-rails', '~> 4.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/api/products/awesome-pants" for 127.0.0.1 at 2014-02-01 17:07:16 -0500 | |
Spree::User Load (1.0ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."spree_api_key" = '6ba5d874b7c63fe8a74bb44ad658f3052a4a1148bd83a5f3' LIMIT 1 | |
(1.1ms) SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = $1 AND "spree_roles"."name" = 'admin' [["user_id", 1]] | |
CACHE (0.0ms) SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = $1 AND "spree_roles"."name" = 'admin' [["user_id", 1]] | |
Spree::Product Load (0.6ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."permalink" = 'awesome-pants' AND ("spree_products".deleted_at IS NULL or "spree_products".deleted_at >= '2014-02-01 22:07:16.271778') LIMIT 1 | |
Spree::Variant Load (0.4ms) SELECT "spree_variants".* FROM "spree_v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/api/products/awesome-pants" for 127.0.0.1 at 2014-02-03 09:27:15 -0500 | |
Spree::User Load (0.6ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."spree_api_key" = '6ba5d874b7c63fe8a74bb44ad658f3052a4a1148bd83a5f3' LIMIT 1 | |
(0.5ms) SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = $1 AND "spree_roles"."name" = 'admin' [["user_id", 1]] | |
CACHE (0.0ms) SELECT COUNT(*) FROM "spree_roles" INNER JOIN "spree_roles_users" ON "spree_roles"."id" = "spree_roles_users"."role_id" WHERE "spree_roles_users"."user_id" = $1 AND "spree_roles"."name" = 'admin' [["user_id", 1]] | |
Spree::Product Load (0.6ms) SELECT "spree_products".* FROM "spree_products" WHERE "spree_products"."slug" = 'awesome-pants' AND ("spree_products".deleted_at IS NULL or "spree_products".deleted_at >= '2014-02-03 14:27:15.814917') ORDER BY "spree_products"."id" ASC LIMIT 1 | |
Spree::ProductProperty Load (0.4ms) S |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started GET "/api/products/the-skinny" for 127.0.0.1 at 2014-02-03 12:17:41 -0500 | |
Spree::User Load (0.6ms) SELECT "spree_users".* FROM "spree_users" WHERE "spree_users"."id" IS NULL LIMIT 1 | |
Token sign-in failed with nil | |
Spree::Product Load (1.1ms) SELECT "spree_products".* FROM "spree_products" INNER JOIN "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id" AND "spree_variants"."is_master" = 't' INNER JOIN "spree_prices" ON "spree_prices"."variant_id" = "spree_variants"."id" WHERE "spree_products"."deleted_at" IS NULL AND "spree_products"."permalink" = 'the-skinny' AND ("spree_products".deleted_at IS NULL or "spree_products".deleted_at >= '2014-02-03 17:17:41.434945') AND ("spree_products".available_on <= '2014-02-03 17:17:41.435128') LIMIT 1 | |
Spree::ProductProperty Load (0.5ms) SELECT "spree_product_properties".* FROM "spree_product_properties" WHERE "spree_product_properties"."product_id" IN (5) ORDER BY spree_product_properties.position | |
Spree::ProductOptionType Load (0.3ms) |