This file contains hidden or 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
Store = function(client) { | |
return { | |
addBuddyWaiting: function(buddy, callback) { | |
client.rpush('buddies', buddy, callback); | |
}, | |
getBuddiesWaiting: function(callback) { | |
client.lrange('buddies', 0, -1, callback); | |
} | |
}; | |
}; |
This file contains hidden or 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
Store = function(client) { | |
return { | |
addBuddyWaiting: function(buddy, callback) { | |
client.rpush(buddies, buddy, callback); | |
}, | |
getBuddiesWaiting: function(callback) { | |
client.lrange('buddies', 0, -1, callback); | |
} | |
}; | |
}; |
This file contains hidden or 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
syntax on | |
set tabstop=2 softtabstop=2 shiftwidth=2 expandtab smarttab | |
set number | |
set nofoldenable | |
set cursorline | |
set showmatch | |
set hlsearch | |
set vb | |
set smartindent | |
set spell |
This file contains hidden or 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 AppointmentObserver < ActiveRecord::Observer | |
def after_save(appointment) | |
user = appointment.user | |
return unless user.notifiable? | |
if appointment.initial? | |
MailService.welcome_email(user).deliver | |
elsif appointment.second_visit? && !user.has_logged_in? | |
MailService.second_chance_email(user).deliver |
This file contains hidden or 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
sdasdf | |
sadf | |
sadf |
This file contains hidden or 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 File.dirname(__FILE__) + '/../acceptance_helper' | |
feature "Logging in on mobile site", %q{ | |
In order to access my site on the go, | |
As a user, | |
I want to log into my site | |
} do | |
switch_driver :mobile |
This file contains hidden or 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
# spec/acceptance/support/helper.rb | |
# ... Other config stuff | |
Capybara.register_driver :mobile do |app| | |
Capybara::RackTest::Driver.new(app, :headers => {'HTTP_USER_AGENT' => 'Mobile'}) | |
end | |
def switch_driver(driver) | |
before(:each) do |
This file contains hidden or 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 'viewing the webpage' do | |
switch_driver :webkit | |
scenario 'viewing from a webkit browser' do | |
... | |
end | |
end | |
This file contains hidden or 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
scenario "Viewing appointment notes" do | |
when 'I visit an appointment details page' do | |
visit my_appointment_path(fitting) | |
end | |
within('.primary') do | |
then 'I should see appointment notes from my dispenser' do | |
find('.quote').should have_content(fitting.notes) | |
find('.quote').should have_content(user.dispenser.first_name) | |
end |
This file contains hidden or 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
# BAD | |
scenario "When I click on an appointment, I am taken to that appointment's details" do | |
visit my_appointments_path | |
find('li.appointment:first-child .block_link').click | |
current_path.should == my_appointment_path(fittings.last) | |
page.should have_css('li.appointment .selected') | |
end |