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
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
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 '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
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 | |
# 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
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
Spree::Admin::ReportsController.class_eval do | |
add_available_report! :some_report | |
def some_report | |
# do something | |
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
class CreateUsers < ActiveRecord::Migration | |
def change | |
create_table :users do |t| | |
t.string :email | |
t.string :first_name | |
t.string :last_name | |
t.timestamps | |
end | |
add_index :users, :email, unique: true |
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
<h1>Welcome#index</h1> | |
<p>Find me in app/views/welcome/index.html.erb</p> | |
<p>Hello <%= @first_name %> <%= @last_name %></p> |