Sha256: 65f3d4e90ccb8c70a3cc5010141e826cf5dfa4b1ed394c0f5a8faa2d29507a1c

Contents?: true

Size: 1.57 KB

Versions: 1

Compression:

Stored size: 1.57 KB

Contents

require './spec_env.rb'

describe "When getting a sites connection strings" do

	before(:all) do
		iis_cfg = Inetmgr::IisConfiguration.new
		site = iis_cfg.get_sites.find { |s| s.name= 'thuis.jolena.be' }
		site.configure do |site_cfg|
			@app_settings = site_cfg.get_connection_strings
		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 = Inetmgr::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 = Inetmgr::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 = generate_random_name()
				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.7.0 spec/site_app_settings_spec.rb