Sha256: 4702ac78522f0fb4ca59d67aaa4081bf5b4e27f3cdc0d7aefc9303e65ee6a3ff
Contents?: true
Size: 987 Bytes
Versions: 25
Compression:
Stored size: 987 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe Github::Users::Emails, '#add' do let(:email) { "octocat@github.com" } let(:request_path) { "/user/emails" } before { subject.oauth_token = OAUTH_TOKEN stub_post(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) { 200 } it 'extracts request parameters and email data' do subject.should_receive(:post_request). with(request_path, { "per_page" => 21, "page" => 1, "data" => [email] }) subject.add email, params end it 'submits request successfully' do subject.add email a_post(request_path).with(:query => { :access_token => "#{OAUTH_TOKEN}"}). should have_been_made end end # add
Version data entries
25 entries across 25 versions & 1 rubygems