Sha256: e7729be2b88e94f9c22764cf258de2d072fe81a444cdab979572b53f6a888809

Contents?: true

Size: 1.49 KB

Versions: 3

Compression:

Stored size: 1.49 KB

Contents

describe 'ignore login profile' do
  let(:dsl) do
    <<-RUBY
      user "bob", :path=>"/devloper/" do
        login_profile :password_reset_required=>true

        policy "S3" do
          {"Statement"=>
            [{"Action"=>
               ["s3:Get*",
                "s3:List*"],
              "Effect"=>"Allow",
              "Resource"=>"*"}]}
        end
      end
    RUBY
  end

  let(:update_dsl) do
    <<-RUBY
      user "bob", :path=>"/devloper/" do
        login_profile :password_reset_required=>false

        policy "S3" do
          {"Statement"=>
            [{"Action"=>
               ["s3:Get*",
                "s3:List*",
                "s3:Put*"],
              "Effect"=>"Allow",
              "Resource"=>"*"}]}
        end
      end
    RUBY
  end

  let(:expected) do
    {:users=>
      {"bob"=>
        {:path=>"/devloper/",
         :groups=>[],
         :policies=>
          {"S3"=>
            {"Statement"=>
              [{"Action"=>["s3:Get*", "s3:List*", "s3:Put*"],
                "Effect"=>"Allow",
                "Resource"=>"*"}]}},
         :attached_managed_policies=>[],
         :login_profile=>{:password_reset_required=>true}}},
     :groups=>{},
     :roles=>{},
     :instance_profiles=>{}}
  end

  before(:each) do
    apply { dsl }
  end

  context 'when no change' do
    subject { client(ignore_login_profile: true) }

    it do
      updated = apply(subject) { update_dsl }
      expect(updated).to be_truthy
      expect(export).to eq expected
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
miam-0.2.2 spec/miam/ignore_login_profile_spec.rb
miam-0.2.2.beta4 spec/miam/ignore_login_profile_spec.rb
miam-0.2.2.beta3 spec/miam/ignore_login_profile_spec.rb