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
{ | |
"acknowledgedWarnings": [ | |
"string" | |
], | |
"listing": { | |
"core": { | |
"uid": "string", | |
"cumulativeDaysOnMarket": 0, | |
"daysOnMarket": 0, | |
"previousStandardStatus": "string", |
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
module Middleware | |
class VersionEndpoint | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
# Return the latest git-sha in ENV if the request is exactly the version endpoint. | |
if env['PATH_INFO'] == '/version' | |
if version = source_version |
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> |
NewerOlder