forked from thoughtbot/high_voltage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb4a53c
commit 4925fd5
Showing
47 changed files
with
215 additions
and
138 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
*.swp | ||
*.swo | ||
.bundle/ | ||
log/*.log | ||
pkg/ | ||
test/dummy/db/*.sqlite3 | ||
test/dummy/log/*.log | ||
test/dummy/tmp/ | ||
spec/dummy/db/*.sqlite3 | ||
spec/dummy/log/*.log | ||
spec/dummy/tmp/ |
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,5 +1,11 @@ | ||
source "http://rubygems.org" | ||
|
||
gem "rails", "3.0.3" | ||
gem "sqlite3-ruby", :require => "sqlite3" | ||
gem "shoulda" | ||
gem "rails", "3.0.10" | ||
gem "capybara", ">= 0.4.0" | ||
gem "sqlite3" | ||
|
||
gem "rspec-rails", ">= 2.0.0.beta" | ||
|
||
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) | ||
# gem 'ruby-debug' | ||
# gem 'ruby-debug19' |
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,37 @@ | ||
require 'spec_helper' | ||
|
||
describe HighVoltage::PagesController do | ||
|
||
render_views | ||
|
||
describe"on GET to /pages/exists" do | ||
before { get :show, :id => 'exists' } | ||
|
||
it "should respond with success and render template" do | ||
response.should be_success | ||
response.should render_template('exists') | ||
end | ||
end | ||
|
||
describe "on GET to /pages/dir/nested" do | ||
before { get :show, :id => 'dir/nested' } | ||
|
||
it "should respond with success and render template" do | ||
response.should be_success | ||
response.should render_template('pages/dir/nested') | ||
end | ||
end | ||
|
||
it "should raise a routing error for an invalid page" do | ||
lambda { get :show, :id => "invalid" }.should raise_error(ActionController::RoutingError) | ||
end | ||
|
||
it "should raise a routing error for a page in another directory" do | ||
lambda { get :show, :id => "../other/wrong" }.should raise_error(ActionController::RoutingError) | ||
end | ||
|
||
it "should raise missing template error for valid page with invalid partial" do | ||
lambda { get :show, :id => "exists_but_references_nonexistent_partial" }.should raise_error(ActionView::MissingTemplate) | ||
end | ||
|
||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
test/dummy/config/database.yml → spec/dummy/config/database.yml
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
require 'spec_helper' | ||
|
||
describe HighVoltage do | ||
it "should be valid" do | ||
HighVoltage.should be_a(Module) | ||
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'spec_helper' | ||
|
||
describe "Navigation" do | ||
include Capybara::DSL | ||
|
||
it "should be a valid app" do | ||
::Rails.application.should be_a(Dummy::Application) | ||
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require 'spec_helper' | ||
|
||
describe 'routes' do | ||
|
||
it "should generate normal resource route with id" do | ||
page_path(:id => "one").should == "/pages/one" | ||
end | ||
|
||
it "should generate normal resource route with string" do | ||
page_path("one").should == "/pages/one" | ||
end | ||
|
||
it "should generate nested route with string" do | ||
page_path("one/two").should == "/pages/one/two" | ||
end | ||
|
||
it "should recognize nested route" do | ||
assert_recognizes({ :controller => "high_voltage/pages", :action => "show", :id => "one/two" }, "/pages/one/two") | ||
end | ||
|
||
it "should recognize normal route" do | ||
assert_recognizes({ :controller => "high_voltage/pages", :action => "show", :id => "one" }, "/pages/one") | ||
end | ||
|
||
it "should recognize normal route with dots" do | ||
assert_recognizes({ :controller => "high_voltage/pages", :action => "show", :id => "one.two.three" }, "/pages/one.two.three") | ||
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
Empty file.
Oops, something went wrong.