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 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 |
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 '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}") |