This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support for creating end destroting buckets (EU and US)
- Loading branch information
marcinbunsch
committed
Sep 22, 2009
1 parent
77d1558
commit 5f49a70
Showing
6 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'spec' | ||
require File.dirname(__FILE__) + '/../lib/helpers' | ||
|
||
describe Helpers do | ||
include Helpers | ||
|
||
describe '#table' do | ||
|
||
before(:each) do | ||
@collection = [ | ||
{:name => 'Foo', :email => '[email protected]', :id => 11}, | ||
{:name => 'Boo', :email => '[email protected]', :id => 34} | ||
] | ||
end | ||
|
||
it 'should render table with no columns' do | ||
result = table(@collection) | ||
result.include?('<tr><th>name</th><th>email</th><th>id</th></tr>').should == true | ||
result.include?('<tr><td>Foo</td><td>[email protected]</td><td>11</td><tr>').should == true | ||
end | ||
|
||
it 'should render table with a block' do | ||
result = table(@collection) { |item| 'copy' } | ||
result.include?('<tr><th>name</th><th>email</th><th>id</th><th>options</th></tr>').should == true | ||
result.include?('<tr><td>Foo</td><td>[email protected]</td><td>11</td><td>copy</td><tr>').should == true | ||
end | ||
|
||
it 'should render table with columns and block' do | ||
result = table(@collection, :name, :email) { |item| 'copy' } | ||
end | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
<% @buckets.each do |bucket| %> | ||
<%= bucket %> <%= link_to 'keys', "/bucket/#{bucket}/keys" %><br/> | ||
<% end %> | ||
<form action="/<%= @project %>/buckets" method="post"> | ||
<input type="text" name="bucket[name]" value="" /> | ||
<select name="bucket[location]"> | ||
<option value="eu">EU</option> | ||
<option value="us">US</option> | ||
</select> | ||
<input type="submit"> | ||
</form> | ||
<%= table(@buckets) do |bucket| | ||
result = link_to('view', "/#{@project}/bucket/#{bucket[:name]}/keys") | ||
result << ' ' + link_to('delete', "/#{@project}/bucket/#{bucket[:name]}/delete") | ||
end %> |