Created
August 13, 2013 19:23
-
-
Save abhishek0/6224731 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe UsersController do | |
render_views | |
describe 'franchisee actions on users' do | |
before :each do | |
fr = FactoryGirl.build(:user, user_type: 'franchisee') | |
fr.set_stamp(FactoryGirl.build(:stamp), FactoryGirl.build(:contact, email: '[email protected]')) | |
fr.save | |
@headers = {"HTTP_AUTHORIZATION" => %{Token token="#{fr.access_token}"}} | |
end | |
it "can add advisors" do | |
u = FactoryGirl.attributes_for(:user, user_type: 'advisor') | |
data = { :format => 'json', :user => u, :contact => FactoryGirl.attributes_for(:contact) } | |
post :create, data, @headers | |
response.status.should eq(200) | |
expect(JSON.parse(response.body)["status"]).to eq "success" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment