Skip to content

Instantly share code, notes, and snippets.

@panSarin
Created January 9, 2019 23:12
Show Gist options
  • Save panSarin/46e3385679033d9502be01d99b2d89a5 to your computer and use it in GitHub Desktop.
Save panSarin/46e3385679033d9502be01d99b2d89a5 to your computer and use it in GitHub Desktop.
describe Admin::Merchant::Create do
subject(:result) { described_class.call(params) }
context "valid data" do
let(:params) {
{
name: "Death Star supplier",
category: "Space Merchants"
}
}
before do
expect(result).to eq(true)
@added_merchant = Merchant.last
end
it "saves our merchant to the database with proper name" do
expect(@added_merchant.name).to eq("Death Start supplier")
end
it "saves our merchant to the database with proper category" do
expect(@added_merchant.category).to eq("Space Merchants")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment