Created
January 9, 2019 23:12
-
-
Save panSarin/46e3385679033d9502be01d99b2d89a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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