Created
August 29, 2012 20:58
-
-
Save renemendoza/3518860 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
### spec | |
let(:mock_call) { double 'Call' } | |
let(:test_extension) { 'ad57366865126e55649ecb23ae1d48887544976efea46a48eb5d85a6eeb4d306' } | |
let(:test_token) { '76f50757ad538f4e34cef18cb13b40248e68854a99a040c2c9b057d65b541402' } | |
subject do | |
#mock_call.stub(:variables) {{}} | |
CallRouterController.new mock_call | |
end | |
it 'retrieves extension and token' do | |
subject.should_receive(:get_variable).with('EXTEN').and_return(:test_extension) | |
subject.should_receive(:sip_get_header).with('x-llamarada-token').and_return(:test_token) | |
#subject.call.variables[:extension].should_not be_nil | |
subject.retrieve_credentials | |
end | |
### call controller | |
def retrieve_credentials | |
self[:extension] = get_variable('EXTEN') | |
self[:token] = sip_get_header('x-llamarada-token') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment