Sha256: b0a58d3a35be6ce3b1caad1b8c7f194fd374a5aac4a0f4585b7fe94bc8d34f9c

Contents?: true

Size: 733 Bytes

Versions: 15

Compression:

Stored size: 733 Bytes

Contents

require 'test_helper'
require "dummy/config/environment"
require 'roar/rails'

module Representer
  module JPG
    class Song; end
    class Album < Roar::Representer::XML; end
  end
end



class RailsRepresenterMethodsTest < MiniTest::Spec
  describe "Rails::RepresenterMethods" do
    before do
      @c = Representer::JPG::Album  # TODO: mix Rails into Base, not XML only.
    end
    
    it "provides conventions for #collection" do
      @c.collection :songs
      
      @d = @c.representable_attrs.first
      assert_equal Representer::JPG::Song, @d.sought_type
      assert @d.array?
    end
    
    it "provides conventions for #representation_name" do
      assert_equal "album", @c.representation_name
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
roar-0.11.4 test/rails/rails_representer_methods_test.rb
roar-0.11.3 test/rails/rails_representer_methods_test.rb
roar-0.11.2 test/rails/rails_representer_methods_test.rb
roar-0.11.1 test/rails/rails_representer_methods_test.rb
roar-0.11.0 test/rails/rails_representer_methods_test.rb
roar-0.10.2 test/rails/rails_representer_methods_test.rb
roar-0.10.1 test/rails/rails_representer_methods_test.rb
roar-0.10.0 test/rails/rails_representer_methods_test.rb
roar-0.9.2 test/rails/rails_representer_methods_test.rb
roar-0.9.1 test/rails/rails_representer_methods_test.rb
roar-0.9.0 test/rails/rails_representer_methods_test.rb
roar-0.8.3 test/rails/rails_representer_methods_test.rb
roar-0.8.2 test/rails/rails_representer_methods_test.rb
roar-0.8.1 test/rails/rails_representer_methods_test.rb
roar-0.8.0 test/rails/rails_representer_methods_test.rb