spec/squall/user_group_spec.rb in squall-1.3.0 vs spec/squall/user_group_spec.rb in squall-1.3.1
- old
+ new
@@ -2,11 +2,11 @@
describe Squall::UserGroup do
before(:each) do
@keys = ["amount"]
@user_group = Squall::UserGroup.new
- @valid = {:label => "My new group"}
+ @valid = {label: "My new group"}
end
describe "#list" do
use_vcr_cassette "user_group/list"
@@ -21,46 +21,30 @@
end
end
describe "#create" do
use_vcr_cassette "user_group/create"
- it "requires label" do
- invalid = @valid.reject{|k,v| k == :label }
- requires_attr(:label) { @user_group.create(invalid) }
- end
- it "raises error on unknown params" do
- expect { @user_group.create(@valid.merge(:what => 'what')) }.to raise_error(ArgumentError, 'Unknown params: what')
- end
-
it "creates a user group" do
@user_group.create(@valid)
@user_group.success.should be_true
end
end
describe "#edit" do
use_vcr_cassette "user_group/edit"
- it "raises error on unknown params" do
- expect { @user_group.edit(1, :what => 'what') }.to raise_error(ArgumentError, 'Unknown params: what')
- end
-
it "edits a user group" do
@user_group.edit(1, @valid)
@user_group.success.should be_true
end
end
describe "#delete" do
use_vcr_cassette "user_group/delete"
- it "requires an id" do
- expect { @user_group.delete }.to raise_error(ArgumentError)
- end
it "deletes a user group" do
@user_group.delete(1)
@user_group.success.should be_true
end
end
-
end
\ No newline at end of file