Sha256: 1d9834496aa39152d211b572b57ecea56f1c4f25dfb64fbb66833ec07f13ee32

Contents?: true

Size: 711 Bytes

Versions: 1

Compression:

Stored size: 711 Bytes

Contents

require 'spec_helper'

describe VulnDBHQ::PrivatePage do

  it "loads :name and :content from the server's JSON body" do
    stub_get('/api/private_pages/1').
    to_return(:status => 200,
      :body => "{\"content\":\"#[Title]#\\r\\nThis is my Private Page\\r\\n\\r\\n\",\"id\":1,\"name\":\"MyPrivatePage\"}",
      :headers => {'Content-Type' => 'application/json; charset=utf-8'})
    client = VulnDBHQ::client
    client.host = TEST_ENDPOINT

    private_page = client.private_page(1)
    private_page.should be
    private_page.should be_a(VulnDBHQ::PrivatePage)
    private_page.name.should eq('MyPrivatePage')
    private_page.content.should eq("#[Title]#\r\nThis is my Private Page\r\n\r\n")
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vulndbhq-0.0.1.beta spec/vulndbhq/private_page_spec.rb