test/maestrano/account/user_test.rb in maestrano-0.11.0 vs test/maestrano/account/user_test.rb in maestrano-0.12.0

- old
+ new

@@ -26,8 +26,28 @@ assert_raises NoMethodError do @api_mock.stubs(:post).returns(test_response(test_account_user)) c = Maestrano::Account::User.create({name: "Bla"}) end end + + context 'with presets' do + setup do + @preset = 'mypreset' + Maestrano[@preset].configure do |config| + config.environment = 'production' + config.api.host = 'https://myprovider.com' + config.api.base = '/myapi' + end + end + + should "should successfully list remote users" do + @api_mock.expects(:get).with do |url, api_token| + url == "#{Maestrano[@preset].param('api.host')}#{Maestrano[@preset].param('api.base')}account/users" && api_token.nil? + end.once.returns(test_response(test_account_user_array)) + + bills = Maestrano::Account::User[@preset].all + assert bills + end + end end end end \ No newline at end of file