Skip to content

Commit

Permalink
Ask for table excludes in DatabaseAdmin#ask_questions
Browse files Browse the repository at this point in the history
  • Loading branch information
NickLaMuro committed Jun 6, 2018
1 parent c696c63 commit 79b9fec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/manageiq/appliance_console/database_admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def ask_questions
setting_header
say(DB_DUMP_WARNING) if action == :dump
ask_file_location
ask_for_tables_to_exclude_in_dump
end

def activate
Expand Down
4 changes: 4 additions & 0 deletions spec/database_admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
it "asks for file location" do
expect(subject).to receive(:say).with("Restore Database From Backup\n\n")
expect(subject).to receive(:ask_file_location)
expect(subject).to receive(:ask_for_tables_to_exclude_in_dump)

subject.ask_questions
end
Expand Down Expand Up @@ -468,6 +469,7 @@ def confirm_and_execute
it "asks for file location" do
expect(subject).to receive(:say).with("Create Database Backup\n\n")
expect(subject).to receive(:ask_file_location)
expect(subject).to receive(:ask_for_tables_to_exclude_in_dump)

subject.ask_questions
end
Expand Down Expand Up @@ -875,12 +877,14 @@ def confirm_and_execute
expect(subject).to receive(:say).with("Create Database Dump\n\n")
expect(subject).to receive(:say).with(pg_dump_warning)
expect(subject).to receive(:ask_file_location)
expect(subject).to receive(:ask_for_tables_to_exclude_in_dump)

subject.ask_questions
end

it "has proper formatting for the pg_dump warning" do
allow(subject).to receive(:ask_file_location)
allow(subject).to receive(:ask_for_tables_to_exclude_in_dump)
subject.ask_questions

expect_output <<-PROMPT.strip_heredoc
Expand Down

0 comments on commit 79b9fec

Please sign in to comment.