1.9.3 fixes

* default all .rb source files to utf-8
 * fix enrollment spec
 * fix external tools spec

Change-Id: Iebbfb580150e67ab95c4126455d405b2c2fe25fa
Reviewed-on: https://gerrit.instructure.com/10719
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
This commit is contained in:
Brian Palmer 2012-05-14 08:55:18 -06:00
parent 0f2fd5ad69
commit 7ecd23899c
3 changed files with 6 additions and 3 deletions

View File

@ -14,6 +14,7 @@ begin
# Set up load paths for all bundled gems
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
Bundler.setup
Encoding.default_internal = Encoding.default_external = 'UTF-8' if defined?(Encoding)
rescue Bundler::GemNotFound
raise RuntimeError, "Bundler couldn't find some gems." +
"Did you run `bundle install`?"

View File

@ -612,8 +612,8 @@ describe EnrollmentsApiController, :type => :integration do
# set up some enrollments that shouldn't be returned by the api
request_user = @user
@new_user = user_with_pseudonym(:name => 'Zombo', :username => 'nobody2@example.com')
@course.enroll_user(@new_user, 'TaEnrollment', 'active')
@course.enroll_user(@new_user, 'ObserverEnrollment', 'active')
@course.enroll_user(@new_user, 'TaEnrollment', :enrollment_state => 'active')
@course.enroll_user(@new_user, 'ObserverEnrollment', :enrollment_state => 'active')
@user = request_user
json = api_call(:get, "#{@path}?type[]=StudentEnrollment&type[]=TeacherEnrollment", @params.merge(:type => %w{StudentEnrollment TeacherEnrollment}))
json.should == (@course.student_enrollments + @course.teacher_enrollments).map { |e|

View File

@ -240,13 +240,15 @@ describe ExternalToolsController, :type => :integration do
hash.delete "created_at"
hash.delete "updated_at"
hash.delete "id"
hash.each_pair do |key, val|
hash.keys.each do |key|
val = hash[key]
next unless val.is_a?(Hash)
val.each_pair do |sub_key, sub_val|
hash["#{key}[#{sub_key}]"] = sub_val
end
hash.delete key
end
hash
end
def example_json(et=nil)