Sha256: d3200a02e5e5906e0f8187fd48797a38bfb59b4d6e32571a7d9f2db5ff94edf8

Contents?: true

Size: 672 Bytes

Versions: 1

Compression:

Stored size: 672 Bytes

Contents

require 'spec_helper'

RSpec.describe OptimizelyServerSide::Support do

  class FakeKlass

    include OptimizelyServerSide::Support


    def some_klass_method

      experiment('foo_experiment_key') do |config|

        config.variation_one('variation_one') do
          'Experience one'
        end

        config.variation_two('variation_two') do
          'Experience two'
        end

      end
    end
  end


  context '#experiment' do

    subject { FakeKlass.new }

    before do
      allow(subject).to receive(:optimizely_sdk_project_instance).and_return('variation_one')
    end

    it { expect(subject.some_klass_method).to eq('Experience one')}
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
optimizely_server_side-0.0.3 spec/optimizely_server_side/helpers/support_spec.rb