Last active
July 3, 2020 13:44
-
-
Save NilsonLima/c61538e6bf6acbae11aa5086e5381358 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
require "test_helper" | |
class Smartphone::Contract::ChangeDeviceTest < ActiveSupport::TestCase | |
setup do | |
@smartphone_contract = smartphone_contracts(:base_contract) | |
@params = { id: @smartphone_contract[:id], imei: '...', imei_secondary: '...', ... } | |
end | |
subject { Smartphone::Contract::ChangeDevice } | |
context "suspended" do | |
should "fail" do | |
# | |
end | |
end | |
context "not suspended" do | |
context "current device match previous" do | |
should "fail" do | |
# | |
end | |
end | |
context "current device mismatch previous" do | |
context "has pending invoices" do | |
should "fail" do | |
# | |
end | |
end | |
context "hasn't pending invoices" do | |
context "previous attributes are invalid" do | |
should "fail" do | |
# | |
end | |
end | |
context "previvous attributes are valid" do | |
context "new attributes are invalid" do | |
should "fail" do | |
# | |
end | |
end | |
context "new attributes are valid" do | |
context "not suspendable" do | |
should "fail" do | |
# | |
end | |
end | |
context "suspendable" do | |
context "certificate changing" do | |
should "fail if operation fails" do | |
# | |
end | |
context "happy path" do | |
should "return success if operation succeeds" do | |
# | |
end | |
end | |
end | |
end | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment