This file contains 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
./script/generate integration selenium_attach_file |
This file contains 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
describe "prototype widget helper", :type => :view do | |
describe "tab1_link" do | |
it "link does some stuff" do | |
pending | |
render(:inline => "<%= tab1_link %>") | |
# response.should have_tag("a") | |
# puts "<pre>" | |
# puts response.body | |
# puts "</pre>" |
This file contains 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
map.resources :users, :controller => 'clearance/users' do |users| | |
users.resource :password, | |
:controller => 'clearance/passwords', | |
:only => [:create, :edit, :update] | |
users.resource :confirmation, | |
:controller => 'clearance/confirmations', | |
:only => [:new, :create] | |
end |
This file contains 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
irb(main):001:0> h = {:foo => "bar", :bar => "foo"} | |
=> {:bar=>"foo", :foo=>"bar"} | |
irb(main):002:0> h | |
=> {:bar=>"foo", :foo=>"bar"} | |
irb(main):003:0> h.respond_to?(:all?) | |
=> true | |
irb(main):004:0> h.all? { |k, v| puts k } | |
bar | |
=> false |
This file contains 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
Given /^There (?:is|are) (\d+|a) (.*?)(.*?)(?: with "(.*?)" for (.*?))?$/ do |count, model, factory_suffix, value, attribute| | |
count = 1 if count == "a" | |
factory_name = model.singularize << factory_suffix.gsub(" ", "_") | |
if attribute and value | |
count.to_i.times { Factory(factory_name.to_sym, attribute.to_sym => value) } | |
else | |
count.to_i.times { Factory(factory_name.to_sym) } | |
end | |
end |
This file contains 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
describe "#route_for" do | |
it "should be nested shallowly under forums as topics" do | |
params_from(:get, '/forums/123/topics').should == {:controller => "forum_posts", :action => "index", :forum_id => "123" } | |
end | |
it "should be nested shallowly under topics as posts" do | |
params_from(:get, '/topics/123/posts').should == {:controller => "forum_posts", :action => "index", :topic_id => "123" } | |
params_from(:get, '/posts/321').should == {:controller => "forum_posts", :action => "show", :id => "321" } | |
end |
This file contains 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
Given /^WH([O]+)AH (.*)$/ do |ohs, actual_step| | |
ohs.length.times { sleep 10 } | |
Given actual_step | |
end | |
# save and open page before | |
Given /^SAOP([BA]) (.*)$/ do |before_or_after, actual_step| | |
save_and_open_page if before_or_after == "B" | |
Given actual_step | |
save_and_open_page if before_or_after == "A" |
This file contains 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
<h1>Custom form demo</h1> | |
<!-- maybe the real thing --> | |
<% form_tag(:action => "create") do %> | |
<% for question in @questions %> | |
<%= hidden_field_tag "responses[][#{question.id}][type]", question.q_type %> | |
<% if question.q_type == "checkbox" %> | |
Checkbox <br/> |
This file contains 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
<% form_tag(:action => "create") do %> | |
<% for question in @questions %> | |
<%= h question[:name] %> | |
<%= hidden_field_tag "responses[][question_id]", question[:id] %> | |
<%= check_box_tag "responses[][flag]" %> <br /> | |
<% end %> | |
<%= submit_tag "Post" %> | |
<% end -%> |
This file contains 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
(in /Users/otto/Desktop/Incubator/shallow_routes) | |
communities GET /communities(.:format) {:action=>"index", :controller=>"communities"} | |
POST /communities(.:format) {:action=>"create", :controller=>"communities"} | |
new_community GET /communities/new(.:format) {:action=>"new", :controller=>"communities"} | |
edit_community GET /communities/:id/edit(.:format) {:action=>"edit", :controller=>"communities"} | |
community GET /communities/:id(.:format) {:action=>"show", :controller=>"communities"} | |
PUT /communities/:id(.:format) {:action=>"update", :controller=>"communities"} | |
DELETE /communities/:id(.:format) {:action=>"destroy", :controller=>"communities"} | |
community_forums GET /communities/:community_id/forums(.:format) {:action=>"index", :controller=>"forums"} | |