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__) + '/../spec_helper' | |
describe MailingsController, 'while secure controller' do | |
configure_controller | |
context 'and not logged in' do | |
before(:each) do | |
set_accounts | |
destroy_user_session | |
end | |
it "should not access actions" 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
require File.dirname(__FILE__) + '/../spec_helper' | |
describe Mailing do | |
fixtures :mailings | |
it "should have some fixtures loaded" do | |
Mailing.should have(3).records | |
end | |
it { should belong_to :account } |
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__) + '/../spec_helper' | |
describe AccountController do | |
as_any_user :get => :show do | |
it { should assign_to(:user, :with => @current_user)} | |
it { should respond_with(:success) } | |
end | |
as_any_user :get => :edit do | |
it { should assign_to(:user, :with => @current_user)} |
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
def factories(*models) | |
models.each do |model| | |
(class << self; self; end).class_eval <<-METHOD | |
def factory_#{model} | |
@#{model} ||= Factory(:#{model}) | |
end | |
METHOD | |
self.class_eval <<-METHOD | |
def factory_#{model} |
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
def index | |
@assets = current_account.assets.paginate :page => params[:page], :per_page => 10 | |
end | |
# How to spec this??? |
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
describe "As a visitor I want to be able to signup and login" do | |
it "should sign up with valid params" do | |
visit root_url | |
click_link "Sign Up" | |
fill_in "Name", :with => "Test User" | |
fill_in "Email", :with => "[email protected]" | |
fill_in "Password", :with => "123mudar" | |
fill_in "Password Confirmation", :with => "123mudar" | |
click_button "Save" |
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
As a Provider | |
I want to be able sign up | |
So that I can can receive Rails project referrals | |
Scenario: Signing up with an invalid password confirmation | |
Given I am on the homepage | |
And I follow "provider.signup" translation | |
And I fill in the provider sign up form for "Pivotpaul Labs" | |
And I fill in the "First name" with "JD" | |
And I fill in the "Last name" with "Crow" |
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
describe "As a visitor I want to be able to signup" do | |
def visit_and_fill_signup_form(valid = true) | |
visit root_url | |
click_link "Sign Up" | |
fill_in "Name", :with => "Test User" | |
fill_in "Email", :with => "[email protected]" | |
fill_in "Password", :with => "123mudar" | |
fill_in "Password Confirmation", :with => "123mudar" if valid | |
click_button "Save" |
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 Users::TaskListsController < InheritedResources::Base | |
defaults :route_prefix => '' | |
before_filter :authenticate_user! | |
belongs_to :user | |
protected | |
def begin_of_association_chain | |
@current_user | |
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
# This declaration .. | |
semantic_menu :class => "top_level_nav" do |root| | |
root.add "Home", root_path | |
root.add "Settings", settings_path do |settings| | |
settings.add "Users", users_path, :activate_for_deeper_paths => true | |
end | |
end | |
# .. would make the "Users" item active for all this URIs |