Sha256: 46fecaba739227219bfa3b0bbfc0debce5405afb709f00fe26cf947ce2c91507

Contents?: true

Size: 1013 Bytes

Versions: 4

Compression:

Stored size: 1013 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Client::Users::Emails, '#list' do
  let(:email) { "octocat@github.com" }
  let(:request_path) { "/user/emails" }

  before {
    subject.oauth_token = OAUTH_TOKEN
    stub_delete(request_path).with(:query => { :access_token => "#{OAUTH_TOKEN}"}).
      to_return(:body => body, :status => status,
        :headers => {:content_type => "application/json; charset=utf-8"})
  }

  after { reset_authentication_for(subject) }

  let(:params) { { :per_page => 21, :page => 1 }}
  let(:body) { fixture('users/emails.json') }
  let(:status) { 204 }

  it 'extracts request parameters and email data' do
    subject.should_receive(:delete_request).
      with(request_path, { "per_page" => 21, "page" => 1, 'data' => [email] })
    subject.delete email, params
  end

  it 'submits request successfully' do
    subject.delete email
    a_delete(request_path).with(:query => { :access_token => "#{OAUTH_TOKEN}" } ).
      should have_been_made
  end
end # delete

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
github_api-0.12.3 spec/github/client/users/emails/delete_spec.rb
github_api-0.12.2 spec/github/client/users/emails/delete_spec.rb
github_api-0.12.1 spec/github/client/users/emails/delete_spec.rb
github_api-0.12.0 spec/github/client/users/emails/delete_spec.rb