Allow charges is disabled if no saved cards marked as default

This commit is contained in:
Jean-Baptiste Bellet
2022-07-22 14:44:11 +02:00
parent 34c8748b9c
commit 0bb90d764c

View File

@@ -121,5 +121,18 @@ describe "Credit Cards", js: true do
end
expect(non_default_card.reload.is_default).to be true
end
context "when no default card" do
before do
default_card.destroy
end
it "then all 'allow_charges' inputs are disabled" do
visit "/account"
find("a", text: /Credit Cards/i).click
expect(find_field('allow_charges', disabled: true)).to be_truthy
end
end
end
end