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
| foo = {} | |
| basenames = ActionController::Routing::Routes.named_routes.routes.keys | |
| basenames.each {|name| foo[name] = false} | |
| Dir.glob(File.join(RAILS_ROOT, '/app', '**', '*.rb')).each do |file| | |
| data = File.read(file) | |
| basenames.each do |basename| | |
| reg = Regexp.new(basename.to_s+"_(?=url|path)") | |
| if reg.match data | |
| foo[basename] = true | |
| 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
| missing_actions = [] | |
| ActionController::Routing::Routes.routes.each do |route| | |
| begin | |
| unless "#{route.defaults[:controller]}_controller".classify.constantize.instance_methods.include? route.defaults[:action] | |
| missing_actions << route.defaults | |
| end | |
| rescue | |
| 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
| controllers = ActionController::Routing::Routes.routes.collect {|r| "#{r.defaults[:controller]}_controller".classify} | |
| non_existent = [] | |
| controllers.uniq.each do |c| | |
| begin | |
| c.constantize | |
| rescue | |
| non_existent << c | |
| 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
| def change_play_game | |
| @game = Game.find(params[:game_id]) | |
| respond_to do |format| | |
| format.js do | |
| render(:update) do |page| | |
| page[:game_display].replace_html(:partial => '/students/display_for_play', :locals => {:game => @game}) | |
| end | |
| end | |
| 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
| Scenario: Visit the local conditions page for a location where conditions are available | |
| Given I have a demonstration site | |
| And the web service knows about "Sydney, NSW" | |
| When I visit "/weather/local-conditions/nsw/sydney" | |
| Then I should see "Sydney current conditions" | |
| And I should see a "Dew point" value of "14" |
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
| require 'singleton' | |
| class String | |
| class TextHelperSingleton | |
| include Singleton | |
| include ActionView::Helpers::TextHelper | |
| end | |
| def method_missing(method, *args) |
NewerOlder