Skip to content

Instantly share code, notes, and snippets.

@panSarin
Created January 9, 2019 22:57
Show Gist options
  • Save panSarin/de10c406ed6c9e3c994a2afcff118486 to your computer and use it in GitHub Desktop.
Save panSarin/de10c406ed6c9e3c994a2afcff118486 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"
}
}
it "saves our merchant to the database" do
expect(result).to eq(true)
added_merchant = Merchant.last
expect(added_merchant.name).to eq("Death Start supplier")
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