summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authortylercloke <tylercloke@gmail.com>2015-06-01 15:09:40 -0700
committertylercloke <tylercloke@gmail.com>2015-06-05 10:38:49 -0700
commitfb73d4ae3a0c20a3c0dfa5a85b652b8f0cba5a32 (patch)
tree55c4821657ad8a8ab106e767e3c52b543dc0b6c4 /spec/unit
parentaa569ebb6fe0c6263bcb93fae80cc65ddfaff481 (diff)
downloadchef-fb73d4ae3a0c20a3c0dfa5a85b652b8f0cba5a32.tar.gz
Fixed bug where boolean fields would not be populated in Chef::User/ApiClient.
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/user_spec.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/unit/user_spec.rb b/spec/unit/user_spec.rb
index 394378e86c..d9872ef5a8 100644
--- a/spec/unit/user_spec.rb
+++ b/spec/unit/user_spec.rb
@@ -51,6 +51,11 @@ describe Chef::User do
expect(@user.send(method)).to eq(true)
end
+ it "should return the false value when false" do
+ @user.send(method, false)
+ expect(@user.send(method)).to eq(false)
+ end
+
it "should throw an ArgumentError if you feed it anything but true or false" do
expect { @user.send(method, Hash.new) }.to raise_error(ArgumentError)
end
@@ -256,7 +261,7 @@ describe Chef::User do
"password" => "password",
"public_key" => "turtles",
"private_key" => "pandas",
- "create_key" => true
+ "create_key" => false
}
@user = Chef::User.from_json(Chef::JSONCompat.to_json(user))
end
@@ -301,8 +306,8 @@ describe Chef::User do
expect(@user.private_key).to eq("pandas")
end
- it "includes the create key status if present" do
- expect(@user.create_key).to be_truthy
+ it "includes the create key status if not nil" do
+ expect(@user.create_key).to be_falsey
end
end