Sha256: c5127bbaa811790ced60a27fc30ebc33352130d503de55593e586ee247d409fc
Contents?: true
Size: 783 Bytes
Versions: 12
Compression:
Stored size: 783 Bytes
Contents
require 'test_helper' require 'roar/representer/feature/client' class ClientTest < MiniTest::Spec representer_for([Roar::Representer]) do property :name property :band end let(:song) { Object.new.extend(rpr).extend(Roar::Representer::Feature::Client) } it "adds accessors" do song.name = "Social Suicide" song.band = "Bad Religion" assert_equal "Social Suicide", song.name assert_equal "Bad Religion", song.band end describe "links" do representer_for([Roar::Representer::JSON, Roar::Representer::Feature::Hypermedia]) do property :name link(:self) { never_call_me! } end it "suppresses rendering" do song.name = "Silenced" song.to_json.must_equal %{{\"name\":\"Silenced\",\"links\":[]}} end end end
Version data entries
12 entries across 12 versions & 1 rubygems