Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 21dd64c2f6
Fetching contributors…

Cannot retrieve contributors at this time

file 19 lines (16 sloc) 0.579 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
require 'minitest_helper'

describe WebAccount do
  it "will be valid with all required fields" do
    account = FactoryGirl.build(:web_account)
    account.must_be :valid?
    account.errors.must_be :empty?
  end

  it "wont be valid without username or password" do
    account1 = FactoryGirl.build(:web_account, :username => nil)
    account2 = FactoryGirl.build(:web_account, :password => nil)

    account1.wont_be :valid?
    account1.errors.has_key?(:username).must_equal true
    account2.wont_be :valid?
    account2.errors.has_key?(:password).must_equal true
  end
end
Something went wrong with that request. Please try again.