Sha256: fa46ce51e009d21ca84000c7c30122fb48167c39fcffec8be092fa0096146490

Contents?: true

Size: 1.57 KB

Versions: 9

Compression:

Stored size: 1.57 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))

class EmployeeTest < Test::Unit::TestCase
  include TestHelper
  include Xeroizer::Record
  
  def setup
    @client = Xeroizer::PublicApplication.new(CONSUMER_KEY, CONSUMER_SECRET)
    @employee = @client.Employee.build

    @employee.employee_id = 'GUID'
    @employee.status = 'ACTIVE'

    @employee.first_name = 'Example'
    @employee.last_name = 'User'

    @employee.date_of_birth = DateTime.strptime("2015-01-01T00:00:00Z")

    @employee.gender = 'F'
    @employee.email = 'user@example.com'

    @employee.start_date = DateTime.strptime("2015-01-02T00:00:00Z")
    @employee.termination_date = DateTime.strptime("2015-01-03T00:00:00Z")
    @employee.is_authorised_to_approve_timesheets = false
    @employee.employee_group_name = "TEAM A"
    @doc = Nokogiri::XML(@employee.to_xml)
  end
  
  it "should render" do
    assert_equal "GUID", @doc.xpath("//EmployeeID").text
    assert_equal "ACTIVE", @doc.xpath("//Status").text
    assert_equal "Example", @doc.xpath("//FirstName").text
    assert_equal "User", @doc.xpath("//LastName").text
    assert_equal "2015-01-01", @doc.xpath("//DateOfBirth").text
    assert_equal "2015-01-02", @doc.xpath("//StartDate").text
    assert_equal "2015-01-03", @doc.xpath("//TerminationDate").text
    assert_equal "F", @doc.xpath("//Gender").text
    assert_equal "user@example.com", @doc.xpath("//Email").text

    assert_equal "false", @doc.xpath("//IsAuthorisedToApproveTimesheets").text
    assert_equal "TEAM A", @doc.xpath("//EmployeeGroupName").text
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
xeroizer-2.20.0 test/unit/models/employee_test.rb
xeroizer-2.19.0 test/unit/models/employee_test.rb
xeroizer-2.18.1 test/unit/models/employee_test.rb
xeroizer-2.17.1 test/unit/models/employee_test.rb
xeroizer-2.16.5 test/unit/models/employee_test.rb
xeroizer-2.16.4 test/unit/models/employee_test.rb
xeroizer-2.16.3 test/unit/models/employee_test.rb
xeroizer-2.16.1 test/unit/models/employee_test.rb
xeroizer-2.16.0 test/unit/models/employee_test.rb