Skip to content

Instantly share code, notes, and snippets.

@zjhuntin
Last active April 12, 2016 17:47
Show Gist options
  • Save zjhuntin/34f4dab0f4a1c5dff3f21770d2bc9c26 to your computer and use it in GitHub Desktop.
Save zjhuntin/34f4dab0f4a1c5dff3f21770d2bc9c26 to your computer and use it in GitHub Desktop.
require File.join(File.dirname(__FILE__), '../test_helper')
describe 'listing activation keys' do
before do
@cmd = %w(activation-key list)
end
it "lists an organizations activation keys" do
params = ['--organization-id=1']
api_expects(:activation_keys, :index, 'Activation key list') do |par|
par["organization_id"] == 1 && par["page"] == 1 &&
par["per_page"] ==1000 && par["search"] == {}
end.returns({
"total" => 0,
"subtotal" => 0,
"page" => "1",
"per_page" => "1000",
"error" => nil,
"search" => nil,
"sort" => {
"by" => nil,
"order" => nil
},
"results" => []
})
expected_result = success_result(
'---|------|------------|-----------------------|-------------
ID | NAME | HOST LIMIT | LIFECYCLE ENVIRONMENT | CONTENT VIEW
---|------|------------|-----------------------|-------------\n')
result = run_cmd(@cmd + params)
assert_cmd(expecting_result, result)
end
end
# Running tests:
..........................F
Finished tests in 0.817227s, 33.0385 tests/s, 50.1696 assertions/s.
1) Failure:
listing activation keys#test_0001_lists an organizations activation keys [/home/vagrant/.rvm/gems/ruby-1.9.3-p551@hammer/gems/apipie-bindings-0.0.16/lib/apipie_bindings/api.rb:169]:
unexpected invocation: #<AnyInstance:ApipieBindings::API>.call_action(<Action :index>, {'organization_id' => 1, 'page' => 1, 'per_page' => 1000, 'sort' => {}}, {}, {:fake_response => nil})
unsatisfied expectations:
- expected exactly once, not yet invoked: Activation key list
#<AnyInstance:ApipieBindings::API>.call_action(:activation_keys, :index, &block)
27 tests, 41 assertions, 1 failures, 0 errors, 0 skips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment