Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

ruby - Cucumber feature on form with Captcha -


if form has captcha (i'm using humanizer gem). how fill form , send , expected result when writing cucumber feature.

scenario: sign valid data   given not authenticated   , on sign in page   when follow "sign up"   , fill in following:     | name                   | administrator            |         | email                  | admin@admin.com          |     | password               | 123456                   |     | password confirmation  | 123456                   |   , fill in captcha correctly   , press "sign up"   should on new_company page   , should see "hello manoj" 

now can write step definition matching /^i fill catcha correctly$/ must put there?

be gentle, i'm new cucumber , it's been frustrating far. i'm not new rails or programming otherwise.

you're right, aditya. putting environment dependent code in models not solution. can "stub" bypass_humanizer? when needed:

# user.rb class user   include humanizer    require_human_on :create, :unless => :bypass_humanizer?    protected    def bypass_humanizer?     false   end end  # step definitions scenarion , /^i fill in captcha correctly$/   # instance of user class skip require_human_on validator   user.any_instance.stubs(:bypass_humanizer?).returns(true) end  # in gemfile group :development, :test   gem "mocha" end 

now have model environment agnostic code , can put in specific state time need (for testing, of course).


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -