spec/unit/provider/user_spec.rb in microwave-1.0.4 vs spec/unit/provider/user_spec.rb in microwave-11.400.2

- old
+ new

@@ -248,28 +248,27 @@ it "should call create_user if the user does not exist" do @provider.user_exists = false @provider.should_receive(:create_user).and_return(true) @provider.action_create - @provider.converge + @provider.set_updated_status @new_resource.should be_updated end it "should call manage_user if the user exists and has mismatched attributes" do @provider.user_exists = true @provider.stub!(:compare_user).and_return(true) @provider.should_receive(:manage_user).and_return(true) @provider.action_create - @provider.converge end it "should set the the new_resources updated flag when it creates the user if we call manage_user" do @provider.user_exists = true @provider.stub!(:compare_user).and_return(true) @provider.stub!(:manage_user).and_return(true) @provider.action_create - @provider.converge + @provider.set_updated_status @new_resource.should be_updated end end describe "action_remove" do @@ -279,25 +278,23 @@ it "should not call remove_user if the user does not exist" do @provider.user_exists = false @provider.should_not_receive(:remove_user) @provider.action_remove - @provider.converge end it "should call remove_user if the user exists" do @provider.user_exists = true @provider.should_receive(:remove_user) @provider.action_remove - @provider.converge end it "should set the new_resources updated flag to true if the user is removed" do @provider.user_exists = true @provider.should_receive(:remove_user) @provider.action_remove - @provider.converge + @provider.set_updated_status @new_resource.should be_updated end end describe "action_manage" do @@ -318,33 +315,30 @@ it "should run manage_user if the user exists and has mismatched attributes" do @provider.should_receive(:compare_user).and_return(true) @provider.should_receive(:manage_user).and_return(true) @provider.action_manage - @provider.converge end it "should set the new resources updated flag to true if manage_user is called" do @provider.stub!(:compare_user).and_return(true) @provider.stub!(:manage_user).and_return(true) @provider.action_manage - @provider.converge + @provider.set_updated_status @new_resource.should be_updated end it "should not run manage_user if the user does not exist" do @provider.user_exists = false @provider.should_not_receive(:manage_user) @provider.action_manage - @provider.converge end it "should not run manage_user if the user exists but has no differing attributes" do @provider.should_receive(:compare_user).and_return(false) @provider.should_not_receive(:manage_user) @provider.action_manage - @provider.converge end end describe "action_modify" do before(:each) do @@ -364,26 +358,24 @@ it "should run manage_user if the user exists and has mismatched attributes" do @provider.should_receive(:compare_user).and_return(true) @provider.should_receive(:manage_user).and_return(true) @provider.action_modify - @provider.converge end it "should set the new resources updated flag to true if manage_user is called" do @provider.stub!(:compare_user).and_return(true) @provider.stub!(:manage_user).and_return(true) @provider.action_modify - @provider.converge + @provider.set_updated_status @new_resource.should be_updated end it "should not run manage_user if the user exists but has no differing attributes" do @provider.should_receive(:compare_user).and_return(false) @provider.should_not_receive(:manage_user) @provider.action_modify - @provider.converge end it "should raise a Chef::Exceptions::User if the user doesn't exist" do @provider.user_exists = false lambda { @provider.action = :modify; @provider.run_action }.should raise_error(Chef::Exceptions::User) @@ -397,18 +389,17 @@ end it "should lock the user if it exists and is unlocked" do @provider.stub!(:check_lock).and_return(false) @provider.should_receive(:lock_user).and_return(true) @provider.action_lock - @provider.converge end it "should set the new resources updated flag to true if lock_user is called" do @provider.stub!(:check_lock).and_return(false) @provider.should_receive(:lock_user) @provider.action_lock - @provider.converge + @provider.set_updated_status @new_resource.should be_updated end it "should raise a Chef::Exceptions::User if we try and lock a user that does not exist" do @provider.user_exists = false @@ -437,10 +428,10 @@ it "should unlock the user if it exists and is locked" do @provider.stub!(:check_lock).and_return(true) @provider.should_receive(:unlock_user).and_return(true) @provider.action_unlock - @provider.converge + @provider.set_updated_status @new_resource.should be_updated end it "should raise a Chef::Exceptions::User if we try and unlock a user that does not exist" do @provider.user_exists = false