Sha256: 27bf8c61306ffcf97ed2acf85c230943df1f3e4b04bae9e075eb4053f3d85bd7

Contents?: true

Size: 1.39 KB

Versions: 2

Compression:

Stored size: 1.39 KB

Contents

require 'spec_helper'

describe "Customer Matchers" do
  include_context "user_context"

  describe "user.rabl" do
    rabl_data(:root => 'user'){ user }
    it{ should render_attribute(:guid) }
    it{ should render_attribute(:first_name) }
    it{ should render_attribute(:last_name) }
    it{ should render_attribute(:email) }
    it{ should_not render_attribute(:password) }
  end

  describe "user_aliases.rabl" do
    rabl_data(:root => 'user'){ user }
    it{ should render_attribute(:id).with(:guid) }
    it{ should render_attribute(:team).with_value('Gorby Puff') }
  end

  describe "index.rabl" do
    rabl_data(:root => 'users', :object_root => 'user'){ [user] }
    it{ should render_attribute(:guid) }
    it{ should render_attribute(:first_name) }
    it{ should render_attribute(:last_name) }
    it{ should render_attribute(:email) }
    it{ should_not render_attribute(:password) }
  end

  describe "rootless_index.rabl" do
    rabl_data(:root => false, :object_root => 'user'){ [user] }
    it{ should render_attribute(:guid) }
    it{ should_not render_attribute(:password) }
  end

  describe "bare_index.rabl" do
    rabl_data(:root => false, :object_root => false){ [user] }
    it{ should render_attribute(:guid) }
    it{ should_not render_attribute(:password) }
  end

  describe "nested/test.rabl" do
    rabl_data(:root => 'test'){ user }
    it{ should render_attribute(:guid) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec_rabl-0.0.3 spec/functional/custom_matchers_spec.rb
rspec_rabl-0.0.2 spec/functional/custom_matchers_spec.rb