Given(/^there are credentials set$/) do Celluloid::Actor[:nestene_core].set_credentials({'a' => 'b'}) end When(/^I get credentials$/) do get '/credentials' end Then(/^I should receive credentials$/) do expect(last_response.status).to be(200) response = JSON.parse(last_response.body) expect(response).to eq({'a' => 'b'}) end When(/^I set credentials$/) do post '/credentials', {'a' => 'b'}.to_json, 'Content-Type' => 'application/json' end Then(/^the credentials should be set$/) do expect(last_response.status).to be(200) expect(Celluloid::Actor[:nestene_core].get_credentials).to eq({'a' => 'b'}) end