Sha256: 8830ee298e4fcadb1a998ce86a62c8d0ac2b082f38d0356b4f2ca698b2589965

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

require './spec_env.rb'

describe "When getting a sites app settings" do

	before(:all) do
		iis_cfg = IisConfiguration.new
		site = iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
		site.configure do |site_cfg|
			@app_settings = site_cfg.get_app_settings
		end
	end

	it "the settings should be returned" do
		@app_settings.size.should == 1
	end

end

describe "When changing an app setting" do

	before(:all) do
		@iis_cfg = IisConfiguration.new
		site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
		site.configure do |site_cfg|
			@previous = site_cfg.get_app_settings[0].value
			site_cfg.get_app_settings[0].value = "foo"
		end
	end

	it "the settings should be persisted" do
		site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
		site.configure do |site_cfg|
			site_cfg.get_app_settings[0].value.should == "foo"
			site_cfg.get_app_settings[0].value = @previous
		end
	end

end

describe "When adding an app setting" do

	before(:all) do
		@iis_cfg = IisConfiguration.new
		site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
		site.configure do |site_cfg|
			@previous = site_cfg.get_app_settings.size
			site_cfg.get_app_settings.add do |setting|
				setting.key ="foo"
				setting.value = "bar"
			end
		end
	end

	it "the settings should be persisted" do
		site = @iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
		site.configure do |site_cfg|
			site_cfg.get_app_settings.size.should == (@previous + 1)
		end
	end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
inetmgr-0.3.0-mswin32 spec/site_app_settings_spec.rb