Sha256: 4a3e30957746f2899d9bcb428d34f58b34329cf7fa29fa44487cf4770fb11114

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require "spec_helper"

describe NPR::Entity::Permissions do
  describe "with all permissions sent" do
    json_fixture do
      <<-JSON
        {
          "download": {
            "allow": "true"
          },
          "stream": {
            "allow": "true"
          },
          "embed": {
            "allow": "true"
          }
        }
      JSON
    end
  
    before :each do
      @permissions = NPR::Entity::Permissions.new(@fixture)
    end
  
    it "sets the permissions" do
      @permissions.download.should eq true
      @permissions.stream.should eq true
      @permissions.embed.should eq true
    end
  end
  
  #-------------------
  
  describe "something is missing" do
    json_fixture do
      <<-JSON
        {
          "download": {
            "allow": "true"
          },
          "stream": {
            "allow": "true"
          }
        }
      JSON
    end
  
    before :each do
      @permissions = NPR::Entity::Permissions.new(@fixture)
    end
  
    it "sets the permissions" do
      @permissions.embed.should eq nil
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
npr-1.1.0 spec/unit/entity/permissions_spec.rb
npr-0.1.2 spec/unit/entity/permissions_spec.rb
npr-0.1.1 spec/unit/entity/permissions_spec.rb
npr-0.1.0 spec/unit/entity/permissions_spec.rb