Sha256: 328c6a5d8ef421fbac45a98b011236609b8162a05ca48a2656fe3f600360c6f0

Contents?: true

Size: 680 Bytes

Versions: 8

Compression:

Stored size: 680 Bytes

Contents

When /^I post some data to "(.*?)" in the API$/ do |route|
  @data = { key: 'all.i.want.to.do', value: 'is.bang.bang.bang' }
  @response = API.post do |req|
    req.url "api/#{route}"
    req.params = @data
  end
end

Then /^I should receive a json response that it was saved successfully$/ do
  @response.status.should be 200
  response_json = JSON.parse(@response.body)
  response_json.class.should eql Hash
  response_json.keys.should_not include 'errors'
  response_json.values.should include 'all.i.want.to.do'
  response_json.keys.should include 'expired'
end

Then /^it should be saved in memcached$/ do
  key = Memcached.get(@data[:key])
  key.should == @data[:value]
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
memcached-manager-0.4.0 features/step_definitions/api/create_memcached_key.rb
memcached-manager-0.3.0 features/step_definitions/api/create_memcached_key.rb
memcached-manager-0.2.2 features/step_definitions/api/create_memcached_key.rb
memcached-manager-0.2.1 features/step_definitions/api/create_memcached_key.rb
memcached-manager-0.2.0 features/step_definitions/api/create_memcached_key.rb
memcached-manager-0.1.0 features/step_definitions/api/create_memcached_key.rb
memcached-manager-0.0.1 features/step_definitions/api/create_memcached_key.rb
memcached-manager-0.0.0 features/step_definitions/api/create_memcached_key.rb