Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a welcoming page prompting to add a Provider #5434

Merged
merged 8 commits into from
May 2, 2019
Prev Previous commit
Next Next commit
Added spec for empty provider screen
  • Loading branch information
romanblanco committed May 2, 2019
commit af2bffc832dadc0dd5bb41a0ddca4d4c982df911
13 changes: 12 additions & 1 deletion spec/controllers/ems_cloud_controller_spec.rb
Original file line number Diff line number Diff line change
@@ -722,7 +722,7 @@ def verify_password_and_confirm(password, verify)
end

it "renders 'Set Default' button when a user defined search exists" do
ems = FactoryBot.create(:ems_amazon)
FactoryBot.create(:ems_amazon)
MiqSearch.create(:db => 'EmsCloud',
:search_type => "user",
:description => 'abc',
@@ -733,6 +733,17 @@ def verify_password_and_confirm(password, verify)
expect(response.body).to have_selector("button[title*='Select a filter to set it as my default']", :text => "Set Default")
end

it "renders a welcoming page when no provider exists" do
MiqSearch.create(:db => 'EmsCloud',
:search_type => "user",
:description => 'abc',
:name => 'abc',
:search_key => session[:userid])
get :show_list
expect(response.status).to eq(200)
expect(response.body).to have_link("Add a Provider")
end

it "does not render set default button when a user defined search does not exist" do
get :show_list
expect(response.status).to eq(200)