Sha256: 8d84c2f8804d1895f861bed0b6460a07fb9667de7603df2a8fe22c301c0bc94d

Contents?: true

Size: 701 Bytes

Versions: 2

Compression:

Stored size: 701 Bytes

Contents

describe RestPack::Core::Service::Models::Host do
  it { should validate_presence_of(:name) }
  it { should validate_presence_of(:application_id) }
  it { should ensure_length_of(:name).is_at_most(256) }
  it { should belong_to(:application) }
  it { should have_many(:domains) }
  it { subject.class.table_name.should == 'restpack_hosts' }

  context "default values" do
    it "has a random session_secret" do
      host1 = create(:host)
      host2 = create(:host)

      host1.session_secret.should_not == nil
      host1.session_secret.should_not == host2.session_secret
    end

    it "has empty oauth_providers as default" do
      create(:host).oauth_providers.should == {}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restpack_core_service-0.0.6 spec/models/host_spec.rb
restpack_core_service-0.0.5 spec/models/host_spec.rb