- Allows a guest to book a tour
spec/features/guest_book_tour_spec.rb
Read through and manually check the feature test for this story
| https://plus.google.com/hangouts/_/calendar/ZGF2aWRqYmV2ZXJpZGdlQGdtYWlsLmNvbQ.0o6bh4pin9d2d5dol1n35khrcc?authuser=1 |
| # put the file into spec/support | |
| shared_examples_for "ActiveModel" do | |
| include ActiveModel::Lint::Tests | |
| # to_s is to support ruby-1.9 | |
| ActiveModel::Lint::Tests.public_instance_methods.map{|m| m.to_s}.grep(/^test/).each do |m| | |
| example m.gsub('_',' ') do | |
| send m | |
| end | |
| end |
| export default FluxStore.extend({ | |
| model: 'store', | |
| events: { | |
| "ASSOCIATE_STORE": 'associate_store' | |
| }, | |
| create(payload) { | |
| return Store.create(payload.data) | |
| }, |
| scope :without_removed, -> { where(arel_table[:removed].eq(nil).or(arel_table[:removed].eq(0))) } | |
| scope :only_removed, -> { where(arel_table[:removed].not_eq(nil)).where(arel_table[:removed].not_eq(0)) } | |
| def self.date_range start_date, end_date | |
| includes(:event). | |
| where(Event.arel_table[:event].gteq(start_date)). | |
| where(Event.arel_table[:event].lteq(end_date)) | |
| end |
| var survey_responses = [ | |
| { | |
| eyes: { | |
| color: 'blue' | |
| }, | |
| flavors: { | |
| favorite: 'vanilla' | |
| } | |
| } |
| var Backbone = require('backbone'); | |
| var _ = require('underscore'); | |
| var MVCObject = function MVCObject() { | |
| if(_.isFunction(this.initialize)) { | |
| this.initialize.apply(this, arguments); | |
| } | |
| }; | |
| _.extend(MVCObject.prototype, Backbone.Events); |
| # A sample Gemfile | |
| source "https://rubygems.org" | |
| gem "pry" |
| var c = console.log.bind(console); // allows you to replace console.log(message) in your code with c(message) |
| module BookingFeatureHelpers | |
| def fill_in_booking_attributes inputs = {} | |
| attrs = booking_attributes.merge user_attributes | |
| attrs.merge! inputs | |
| attrs = attrs.with_indifferent_access | |
| [:name, :email, :phone_number, :number_of_people].each do |field| | |
| if attrs[field].present? | |
| find("[name*=#{field.to_s}]").set attrs[field] |