- added 'spec' rake task to run all specs

- added spec to confirm that localization is working
This commit is contained in:
Matt Zukowski 2010-12-09 09:33:54 -05:00
Родитель 7b656f489c
Коммит 9fdf2472c7
3 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -65,6 +65,17 @@ describe 'CASServer' do
page.should have_xpath('//input[@id="service"]', :value => @target_service)
end
it "uses appropriate localization when 'lang' prameter is given" do
visit "/login?lang=pl"
page.should have_content("Użytkownik")
visit "/login?lang=pt_BR"
page.should have_content("Usuário")
visit "/login?lang=en"
page.should have_content("Username")
end
end # describe '/login'

Просмотреть файл

@ -12,8 +12,11 @@ set :run, false
set :raise_errors, true
set :logging, false
# Avoid potential weirdness by changing the working directory to the CASServer root
FileUtils.cd('..')
if Dir.getwd =~ /\/spec$/
# Avoid potential weirdness by changing the working directory to the CASServer root
FileUtils.cd('..')
end
def silence_warnings
old_verbose, $VERBOSE = $VERBOSE, nil

6
tasks/spec.rake Normal file
Просмотреть файл

@ -0,0 +1,6 @@
require 'spec/rake/spectask'
desc 'Run RSpecs to confirm that all functionality is working as expected'
Spec::Rake::SpecTask.new('spec') do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
end