Skip to content

Instantly share code, notes, and snippets.

Avatar

Philip Ingram pjammer

View GitHub Profile
View 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
View snippet.rb
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}")
You can’t perform that action at this time.