Sha256: ce25d8bd4c680ed8b4a41053163e75ea22a9e7f041ccb42cc3e6d64046e14c1b

Contents?: true

Size: 772 Bytes

Versions: 1

Compression:

Stored size: 772 Bytes

Contents

describe "Renderer Scope" do
  include_context "user_context"

  describe "user_renderer_scope.rabl" do
    rabl_data(:root => 'user'){ user }
    rabl_config(scope: RendererScopeHelper)

    it{ expect(subject).to render_attribute(:full_name).with_value('gob bluth') }
    it{ expect(subject).to render_attribute(:formatted_email).with_value('"gob bluth" <gob@bluth.com>') }
    it{ expect(subject).to render_attribute(:password).with_value('***********') }
  end

  describe "user_renderer_scope.rabl (without scope supplied)" do
    rabl_data(:root => 'user'){ user }
    rabl_template { "user_renderer_scope.rabl" }

    it "should fail if not configured with an appropriate scope" do
      expect{ rendered_template  }.to raise_error(NoMethodError)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-rabl-2.1.0 spec/functional/renderer_scope_spec.rb