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

Reload button should use the current display value #2419

Merged
merged 2 commits into from Nov 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/ansible_repository_controller.rb
Expand Up @@ -40,7 +40,7 @@ def button
page.replace("gtl_div", :partial => "layouts/gtl")
end
elsif params[:pressed] == 'ansible_repository_reload'
@display = 'summary_only'
params[:display] = @display if @display
show
render :update do |page|
page << javascript_prologue
Expand Down
8 changes: 8 additions & 0 deletions spec/controllers/ansible_repository_controller_spec.rb
Expand Up @@ -47,5 +47,13 @@
expect(response.status).to eq(200)
expect(response.body).to include("Test Repository (All Playbooks)")
end

it 'reload button will stay on the nested list' do
get :show, :params => {:id => @repository.id, :display => 'playbooks'}
expect(response.status).to eq(200)
post :button, :params => { :id => @repository.id, :pressed => 'ansible_repository_reload' }
expect(response.status).to eq(200)
expect(response).to render_template(:partial => "layouts/_gtl")
end
end
end