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
DASH | |
------ | |
:Dash[!] | |
:Dash printf | |
:Dash setTimeout javascript | |
:Dash! | |
:Dash! func #Will search for 'func' in all docsets. | |
:DashKeywords | |
:DashKeywords backbone underscore javascript |
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
<h4><%= @product[0].quote.category.name.titleize if @product.present? %> Products</h4> | |
<% if @product.present? %> | |
<%= render partial: '/products/listings', locals: { product: @product } %> | |
<% else %> | |
<p>The are no agape love quotes</p> | |
<%= render partial: '/products/no_product' %> | |
<% 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 SearchController < ApplicationController | |
before_action :set_search_option, only: [:index] | |
# Query the product model and return all indexed items. | |
def index | |
@product_results = ProductsIndex.aggregations(search_aggregations) | |
apply_filters(@search_options[:search_with]).each { |filter| @product_results = @product_results.merge(filter) } | |
# Apply any facet filters already selected | |
if @search_term.present? |
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
gem 'rails', '3.2.6' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'mysql2' | |
gem 'heroku' | |
gem 'newrelic_rpm' | |
gem 'exception_notification' |
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
Given /^a user visits the signin page$/ do | |
visit signin_path | |
end | |
When /^he submits invalid information$/ do | |
click_button "Sign in" | |
end | |
Then /^he should see an error message$/ do | |
page.should have_selector('div.alert.alert-error') |
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
Feature: Signing in | |
Scenario: Unsuccessful signin | |
Given a user visits the signin page | |
When he submits invalid information | |
Then he should see an error message | |
Scenario: Successful signin | |
Given a user visits the signin page | |
And the user has an account |
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 SessionsController < ApplicationController | |
def new | |
end | |
def create | |
user = User.find_by_email(params[:session][:email]) | |
if user && user.authenticate(params[:session][:password]) | |
sign_in user | |
redirect_to user |
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 ApplicationHelper do | |
describe "full_title" do | |
it "should include the page title" do | |
full_title("foo").should =~ /foo/ | |
end | |
it "should include the base title" do |
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
# == Schema Information | |
# | |
# Table name: users | |
# | |
# id :integer not null, primary key | |
# name :string(255) | |
# email :string(255) | |
# created_at :datetime not null | |
# updated_at :datetime not null | |
# |
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 "authentication" do | |
subject { page } | |
describe "signin page" do | |
before { visit signin_path } | |
describe "with invalid information" do |
OlderNewer