Skip to content

Instantly share code, notes, and snippets.

View pjammer's full-sized avatar

Philip Ingram pjammer

View GitHub Profile
@pjammer
pjammer / snippet.rb
Created February 11, 2010 00:33 — forked from seivan/snippet.rb
class Post
has_many :comments
has_many :tags, :as => :taggable
class Comment
belongs_to :post
has_many :tags, :as => :taggable
class Tag
belongs_to :taggable, :polymorphic => true
require 'test_helper'
class AuthenticationTest < ActionController::IntegrationTest
def log_and_say(user, arg)
login_on_admin(user.username, user.password)
assert_content arg
end
test "Login on admin with valid username, password and role" do
user = Factory.build(:user_admin)
log_and_say(user, "Welcome #{user.username}, logged in as #{user.role}")