Sha256: 170a4303680e44f567bffbf80debaecd877136d1a2222b6018b8cc263b41042a
Contents?: true
Size: 1.19 KB
Versions: 7
Compression:
Stored size: 1.19 KB
Contents
$:.unshift(File.dirname(__FILE__)) require 'helpers/unit_test_helper' require 'models/location' require 'models/note' require 'models/project' require 'models/task' require 'models/user' require 'models/simple_property' class ToFxmlTest < ActiveRecord::TestCase fixtures :locations, :notes, :projects, :tasks, :users, :simple_properties def test_to_fxml_sanity assert_nothing_raised {users(:ludwig).to_fxml} end def test_to_fxml_doesnt_dasherize set_response_to users(:ludwig).to_fxml assert_xml_select 'user first_name', 'Ludwig' end def test_default_xml_methods_on_user_are_included_in_fxml set_response_to users(:ludwig).to_fxml(:methods => [:has_nothing_to_do, :full_name]) assert_xml_select 'user full_name', 'Ludwig van Beethoven' assert_xml_select 'user has_nothing_to_do' end def test_default_xml_methods_on_user_are_included_in_fxml_if_you_call_it_twice set_response_to users(:ludwig).to_fxml(:methods => [:has_nothing_to_do, :full_name]) set_response_to users(:ludwig).to_fxml(:methods => [:has_nothing_to_do, :full_name]) assert_xml_select 'user full_name', 'Ludwig van Beethoven' assert_xml_select 'user has_nothing_to_do' end end
Version data entries
7 entries across 7 versions & 4 rubygems