test/unit/models/employee_test.rb in xeroizer-2.20.0 vs test/unit/models/employee_test.rb in xeroizer-3.0.0
- old
+ new
@@ -1,13 +1,13 @@
-require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))
+require 'unit_test_helper'
class EmployeeTest < Test::Unit::TestCase
include TestHelper
include Xeroizer::Record
-
+
def setup
- @client = Xeroizer::PublicApplication.new(CONSUMER_KEY, CONSUMER_SECRET)
+ @client = Xeroizer::OAuth2Application.new(CLIENT_ID, CLIENT_SECRET)
@employee = @client.Employee.build
@employee.employee_id = 'GUID'
@employee.status = 'ACTIVE'
@@ -23,10 +23,10 @@
@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