Skip to content

Commit

Permalink
Change 'request_view' option to 'display_view_only'
Browse files Browse the repository at this point in the history
  • Loading branch information
eclarizio committed Mar 8, 2017
1 parent ff6d20c commit 80f76e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/resource_action_workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def load_dialog(resource_action, values, options)
dialog = resource_action.dialog unless resource_action.nil?
unless dialog.nil?
dialog.target_resource = @target
if options[:request_view]
if options[:display_view_only]
dialog.init_fields_with_values_for_request(values)
else
dialog.init_fields_with_values(values)
Expand Down
10 changes: 5 additions & 5 deletions spec/models/resource_action_workflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
let(:resource_action) { instance_double("ResourceAction", :id => 123, :dialog => dialog) }
let(:dialog) { instance_double("Dialog", :id => 321) }
let(:values) { "the values" }
let(:options) { {:request_view => request_view} }
let(:options) { {:display_view_only => display_view_only} }

before do
allow(ResourceAction).to receive(:find).and_return(resource_action)
Expand All @@ -130,17 +130,17 @@
allow(dialog).to receive(:target_resource=)
end

context "when the options set request_view to true" do
let(:request_view) { true }
context "when the options set display_view_only to true" do
let(:display_view_only) { true }

it "calls init_fields_with_values_for_request" do
expect(dialog).to receive(:init_fields_with_values_for_request).with(values)
ResourceActionWorkflow.new(values, nil, resource_action, options)
end
end

context "when the options set request_view to false" do
let(:request_view) { false }
context "when the options set display_view_only to false" do
let(:display_view_only) { false }

it "calls init_fields_with_values" do
expect(dialog).to receive(:init_fields_with_values).with(values)
Expand Down

0 comments on commit 80f76e9

Please sign in to comment.