require File.expand_path('../../../spec_helper', __FILE__)
require 'app/controllers/api/owners_controller'

module Pod::TrunkApp
  describe OwnersController, 'concerning the details of a single owner' do
    extend SpecHelpers::Response

    before do
      header 'Content-Type', 'application/json'
    end

    it 'shows an owners public attributes' do
      owner = Owner.unclaimed
      get "/#{owner.email}"
      last_response.status.should == 200
      attributes = owner.public_attributes
      json_response.should == JSON.parse(attributes.to_json)
    end
  end
end

require File.expand_path('../../../spec_helper', __FILE__)
require 'app/controllers/api/owners_controller'

module Pod::TrunkApp
  describe OwnersController, 'concerning the details of a single owner' do
    extend SpecHelpers::Response

    before do
      header 'Content-Type', 'application/json'
    end

    it 'shows an owners public attributes' do
      owner = Owner.unclaimed
      get "/#{owner.email}"
      last_response.status.should == 200
      attributes = owner.public_attributes
      json_response.should == JSON.parse(attributes.to_json)
    end

    it '404s if no such owner is found' do
      get '/not-even-a-valid-email'
      last_response.status.should == 404
    end
  end
end

Verify 404 if no owner is found
[Spec] Verify 404 if no owner is found
