I hereby claim:
- I am ropiku on github.
- I am mihaianca (https://keybase.io/mihaianca) on keybase.
- I have a public key ASDbMQEBGbSPjW4fdq7SGm_2N1oumJ35TTO8jFbxpwOt3go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<style type="text/css"> | |
@media only screen and (max-device-width: 480px) { | |
table[class=outer] .global-width-670-to-320 { | |
width: 320px !important; |
require 'eventmachine' | |
require 'mq' | |
module Echo | |
def initialize(mq) | |
@mq = mq | |
end | |
def receive_data(data) | |
@mq.queue('log').publish(data) | |
end |
def self.authenticate(email, password) | |
user = find(:first, :conditions => ['username = ? OR email = ?', email.to_s.downcase, email.to_s.downcase]) | |
user && user.authenticated?(password) ? user : nil | |
end |
context "A user" do | |
setup do | |
@user = Factory(:user) | |
@password = @user.password | |
end | |
should "authenticate with username and good credentials" do | |
assert User.authenticate(@user.username, @password) | |
assert @user.authenticated?(@password) | |
end |
require File.dirname(__FILE__) + '/../test_helper' | |
class SessionsControllerTest < ActionController::TestCase | |
include Clearance::Test::Functional::SessionsControllerTest | |
context "Given an email confirmed user" do | |
setup do | |
@user = Factory(:user) | |
@user.confirm_email! | |
end |
require File.dirname(__FILE__) + '/../test_helper' | |
class UsersControllerTest < ActionController::TestCase | |
include Clearance::Test::Functional::UsersControllerTest | |
public_context do | |
context "When getting new User view" do | |
setup { get :new } | |
should "display username field" do |
class User < ActiveRecord::Base | |
include Clearance::App::Models::User | |
attr_accessible :username | |
validates_presence_of :username | |
validates_uniqueness_of :username | |
end |
require File.dirname(__FILE__) + '/../test_helper' | |
class UserTest < Test::Unit::TestCase | |
include Clearance::Test::Unit::UserTest | |
should_allow_mass_assignment_of :username | |
context "When signing up" do | |
should_validate_presence_of :username | |
end |