This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ActiveSupport::TestCase | |
| def login_as(user) | |
| @request.session[:user_id] = user ? users(user).id : nil | |
| end | |
| def current_user | |
| @current_user ||= User.find(@request.session[:user_id]) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ready = function() { | |
| $('a#toggle_all_standards_search_form').click(function() { | |
| $('div#course_standards').html(''); | |
| $('div#all_standards').show(); | |
| return false; | |
| }); | |
| }; | |
| $(document).ready(ready); | |
| $(document).on('page:load', ready); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| h = Hash.new(0) | |
| Dir.glob(Rails.root.join('app','helpers','*.rb')).each do |file| | |
| File.read(file).lines.each do |line| | |
| if line[/^[ ]+def ([a-zA-Z0-9!_]+)/] | |
| h[$1] += 1 | |
| end | |
| end | |
| end | |
| h.each {|key, value| puts key if value > 1} |