Skip to content

Instantly share code, notes, and snippets.

View leemcalilly's full-sized avatar

Lee McAlilly leemcalilly

View GitHub Profile
@leemcalilly
leemcalilly / gist:1677202
Created January 25, 2012 16:46
Password Reset Spec
it "successfully logs out" do
visit root_path
click_link "Log Out"
visit login_path
save_and_open_page
end
@leemcalilly
leemcalilly / gist:1674304
Created January 25, 2012 02:45
app/controllers/sessions_controller.rb
class SessionsController < ApplicationController
def new
end
def create
user = login(params[:email], params[:password], params[:remember_me])
if user
redirect_back_or_to root_url, :notice => "Logged in!"
else
flash.now.alert = "Email or password was invalid"
@leemcalilly
leemcalilly / gist:1674293
Created January 25, 2012 02:42
views/sessions/new.html.erb
<% provide(:title, 'Log In') %>
<h1>Log In</h1>
<%= form_tag sessions_path do %>
<fieldset>
<%= label_tag :email %>
<%= text_field_tag :email, params[:email] %>
</fieldset>
<fieldset>
@leemcalilly
leemcalilly / gist:1674257
Created January 25, 2012 02:33
visit /login
it "successfully routes to the login page" do
visit login_path
current_path.should == "/login"
print page.html
end
@leemcalilly
leemcalilly / gist:1665371
Created January 23, 2012 20:26
index.html.erb
<div id="search_results">
<%- if @results.empty? %>
<p>Sorry - there were no results for "<strong><%= params[:search] %></strong>".</p>
<p><%= link_to "Return to your homepage", root_path %>.</p>
<%- end %>
<% @results.each do |result| %>
<% if result.kind_of?(PartnerPage) %>
<h2><%= link_to result.title, partner_path(result) %></h2>
@leemcalilly
leemcalilly / gist:1665365
Created January 23, 2012 20:25
index.html.erb_spec.rb
require "spec_helper"
describe "search/index.html.erb" do
context "when search results are empty" do
before do
assign(:results, double('results').as_null_object)
controller.params[:search] = "user query"
template.stub(:paginate).and_return(nil)
end
https://s3.amazonaws.com/achievenext-dev-heroku-backups/events/photos/small/107.jpg?1323792591
@leemcalilly
leemcalilly / gist:1643090
Created January 19, 2012 21:54
Hosting and Maintenance Costs for AchieveNext White Label

Hosting and Maintenance Costs for AchieveNext White Label

Hosting Services that We Manage for You

Amazon Web Services

  • Amazon is the company we use for hosting and the cost depends completely on your traffic and storage needs
  • You only pay for what you use (We average around $60 per month)
  • We can give them our monthly costs as an example; If they can tell us the traffic they expect we can do an estimate for them
@leemcalilly
leemcalilly / gist:1601155
Created January 12, 2012 15:36
How to use the Sorella Content Management System (CMS)
<iframe src="http://player.vimeo.com/video/25762842?title=0&amp;byline=0&amp;portrait=0&amp;color=366c96" width="440" height="248" frameborder="0"></iframe>