Skip to content

Instantly share code, notes, and snippets.

@keppy
Created August 31, 2012 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keppy/3548104 to your computer and use it in GitHub Desktop.
Save keppy/3548104 to your computer and use it in GitHub Desktop.
First tests
require "minitest_helper"
class EmployeeTest < MiniTest::Unit::TestCase
def setup
super
@employee = Employee.new(first_name: "Jannis", last_name: "Steele")
@user = User.new(login: "Geoblaster", password: "foobar", password_confirmation: "foobar", email: "hero@mcpooch.com")
@employee.user = @user
end
def test_display_name
assert_equal "#{@employee.first_name} #{@employee.last_name}", @employee.display_name
end
def test_user_login
assert_equal "#{@employee.user.login}", @employee.user_login
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment