spec/models/logical/naf/application_spec.rb in naf-2.0.4 vs spec/models/logical/naf/application_spec.rb in naf-2.1.0

- old
+ new

@@ -1,30 +1,25 @@ require 'spec_helper' module Logical module Naf + describe Application do let(:columns) { [:id, :title, :short_name, :script_type_name, - :application_run_group_name, - :application_run_group_restriction_name, - :application_run_group_limit, - :enabled, - :enqueue_backlogs, - :run_time, - :affinities, - :prerequisites, - :deleted, - :visible] } - let(:physical_app) { FactoryGirl.create(:application, application_schedule: FactoryGirl.create(:schedule_base)) } + :application_schedules, + :deleted] } + let(:physical_app) { FactoryGirl.create(:application) } let!(:logical_app) { Application.new(physical_app) } - let(:scheduled_physical_app) { - FactoryGirl.create(:scheduled_application, application_schedule: FactoryGirl.create(:schedule_at_time)) - } + let(:scheduled_physical_app) { FactoryGirl.create(:scheduled_application) } + before do + physical_app.application_schedules << FactoryGirl.create(:schedule_base) + end + context "Class Methods" do it "search method should return array of wrapper around physical application" do Application.search(params: nil).map(&:id).should include(logical_app.id) Application.search(params: nil).should have(2).items Application.search(params: nil).should be_a(Array) @@ -36,32 +31,9 @@ logical_app.command end it "to_hash should have the specified columns" do logical_app.to_hash.keys.should == columns - end - - it "should render run_start_minute" do - scheduled_physical_app.application_schedule.run_start_minute.should be_a(Fixnum) - - Application.new(scheduled_physical_app).run_start_minute.should be_a(String) - end - - it "should delegate methods to its schedule" do - methods = [:application_run_group_restriction_name, - :run_interval, - :application_run_group_name, - :run_start_minute] - schedule = scheduled_physical_app.application_schedule - logical_scheduled_app = Application.new(scheduled_physical_app) - - methods.each do |m| - schedule.should_receive(m).and_return(nil) - end - - methods.each do |m| - logical_scheduled_app.send(m) - end end end end end