Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Staging task should return the app's owner when #user is called

Test plan:
- New unit test

Change-Id: Ide403ebf8595718665029deb0024182849405689
  • Loading branch information...
commit 0102004dbc5043f958ca08fe699e02bfffee38dd 1 parent f78e2a4
mpage authored
View
5 cloud_controller/app/models/staging_task.rb
@@ -43,6 +43,10 @@ def initialize(app, opts={})
}
end
+ def user
+ @app.owner
+ end
+
def run(timeout=AppConfig[:staging][:max_staging_runtime])
stager_client = VCAP::Stager::Ipc::FiberedNatsClient.new(@nats)
begin
@@ -59,7 +63,6 @@ def run(timeout=AppConfig[:staging][:max_staging_runtime])
result
end
-
def cleanup
FileUtils.rm_f(@upload_path)
end
View
11 cloud_controller/spec/models/staging_task_spec.rb
@@ -46,9 +46,18 @@
end
end
- def create_stub_app(id)
+ describe '#user' do
+ it 'should be the owner of the app being staged' do
+ app = create_stub_app(1, 'test')
+ task = StagingTask.new(app)
+ task.user.should == app.owner
+ end
+ end
+
+ def create_stub_app(id, owner=nil)
app = stub("app_#{id}")
app.stubs(:id).returns(id)
+ app.stubs(:owner).returns(owner)
app
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.