-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable Order button and add flash message to Catalog Item's details
- Loading branch information
Hilda Stastna
committed
Jan 29, 2020
1 parent
3e953fc
commit 150ef99
Showing
4 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
describe "catalog/_svccat_tree_show.html.haml" do | ||
let(:service) { FactoryBot.create(:service_template) } | ||
|
||
before do | ||
assign(:record, service) | ||
assign(:sb, {}) | ||
assign(:template_valid, true) | ||
end | ||
|
||
it 'enables Order button' do | ||
render :partial => 'catalog/svccat_tree_show' | ||
expect(response).to include("<button name=\"button\" type=\"submit\" class=\"btn btn-primary\" alt=\"Order this Service\" title=\"Order this Service\" onclick=\"miqOrderService(#{service.id})\">Order</button>") | ||
end | ||
|
||
context 'invalid Catalog items or Bundles' do | ||
before { assign(:template_valid, false) } | ||
|
||
it 'disables Order button' do | ||
render :partial => 'catalog/svccat_tree_show' | ||
expect(response).to include("<button name=\"button\" type=\"submit\" class=\"btn btn-primary\" alt=\"This Service cannot be ordered\" title=\"This Service cannot be ordered\" disabled=\"disabled\" onclick=\"miqOrderService(#{service.id})\">Order</button>") | ||
end | ||
end | ||
end |