Sha256: ebe5d9cc88996a3f9bad27d3863d906ba36f3b985dc89266ce67187e9bef2d37

Contents?: true

Size: 888 Bytes

Versions: 7

Compression:

Stored size: 888 Bytes

Contents

# -*- indent-tabs-mode: nil; fill-column: 110 -*-
require "rspec"
require "spec_helper"
require "chef_fixie"
require "chef_fixie/config"

RSpec.describe ChefFixie::Sql::Groups, "Group access" do
  let (:test_org_name) { "ponyville" }
  let (:orgs) { ChefFixie::Sql::Orgs.new }
  let (:users) { ChefFixie::Sql::Users.new }
  let (:test_org) { orgs[test_org_name] }

  # TODO this should use a freshly created object and purge it afterwords.
  # But we need to write the create object feature still

  context "Groups" do
    let (:testgroup) { test_org.groups["admins"] }
    let (:adminuser) { users["rainbowdash"] }
    let (:notadminuser) { users["mary"] }

    it "Members are part of the group" do
      expect(testgroup.member?(adminuser)).to be true
    end
    it "Members are not part of the group" do
      expect(testgroup.member?(notadminuser)).to be false
    end

  end

end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
chef_fixie-1.0.8 spec/chef_fixie/groups_spec.rb
chef_fixie-1.0.7 spec/chef_fixie/groups_spec.rb
chef_fixie-1.0.3 spec/chef_fixie/groups_spec.rb
chef_fixie-1.0.2 spec/chef_fixie/groups_spec.rb
chef_fixie_shahid-0.5.2 spec/chef_fixie/groups_spec.rb
chef_fixie-0.5.1 spec/chef_fixie/groups_spec.rb
chef_fixie-0.5.0 spec/chef_fixie/groups_spec.rb