Hi,
First of all great work! I’m looking forward to building my first application on Jets!
I’m trying to set up my Jets app with a local dynamodb instance (https://github.com/tongueroo/jets/wiki/Dynamodb-Local-Setup-Walkthrough) and model rspec tests. Running rspec
results in the following error:
1) App creates app
Failure/Error: app.replace
Aws::Errors::MissingCredentialsError:
unable to sign request without credentials set
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/signature_v4.rb:72:in `sign_request'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/signature_v4.rb:112:in `apply_signature'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/signature_v4.rb:65:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/helpful_socket_errors.rb:10:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/retry_errors.rb:171:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/json/handler.rb:11:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/user_agent.rb:13:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/seahorse/client/plugins/endpoint.rb:45:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/param_validator.rb:24:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/seahorse/client/plugins/raise_response_errors.rb:14:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-dynamodb-1.19.0/lib/aws-sdk-dynamodb/plugins/simple_attributes.rb:117:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/seahorse/client/plugins/response_target.rb:23:in `call'
# /var/lib/gems/2.5.0/gems/aws-sdk-core-3.44.2/lib/seahorse/client/request.rb:70:in `send_request'
# /var/lib/gems/2.5.0/gems/aws-sdk-dynamodb-1.19.0/lib/aws-sdk-dynamodb/client.rb:3163:in `put_item'
# /var/lib/gems/2.5.0/gems/jets-1.4.8/vendor/dynomite/lib/dynomite/item.rb:209:in `replace'
# /var/lib/gems/2.5.0/gems/jets-1.4.8/vendor/dynomite/lib/dynomite/item.rb:70:in `replace'
# ./spec/models/app_spec.rb:4:in `block (2 levels) in <top (required)>'
Everything seems to be working fine in development environment though - I can access the local dynamodb instance from a controller using a web browser without any issues.
I am doing something wrong? Is running tests using rspec
is the correct way of doing it?
Edit
Here’s the code:
require 'spec_helper'
describe App, type: :model do
it "creates app" do
app = App.new
app.replace
end
end
Edit 2
models/app.rb code:
class App < ApplicationItem
end