-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorganize test/test_helper.rb and features/env.rb files so that the …
…engine generator works better for engines outside of the adva-cms2 repository should probably make things completely independend from hardcoded load paths
- Loading branch information
Sven Fuchs
committed
Jan 25, 2011
1 parent
5a91a0f
commit 260c460
Showing
21 changed files
with
66 additions
and
25 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 +1,2 @@ | ||
require File.expand_path('../../../adva-core/lib/testing/env', __FILE__) | ||
require File.expand_path('../../../features/env', __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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
require File.expand_path('../../../adva-core/test/test_helper', __FILE__) | ||
require File.expand_path('../../../test/test_helper', __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
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 +1,3 @@ | ||
require File.expand_path('../../../adva-core/test/test_helper', __FILE__) | ||
require File.expand_path('../../../test/test_helper', __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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require File.expand_path('../../../adva-core/lib/testing/env', __FILE__) | ||
require File.expand_path('../../../features/env', __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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
require File.expand_path('../../../adva-core/test/test_helper', __FILE__) | ||
require File.expand_path('../../../test/test_helper', __FILE__) | ||
|
||
|
||
require 'adva-categories' |
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,3 @@ | ||
require File.expand_path('../../../features/env', __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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Feature: <%= name.titleize %> | ||
|
||
Scenario: |
12 changes: 12 additions & 0 deletions
12
adva-core/lib/adva/generators/templates/engine/paths.rb.erb
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,12 @@ | ||
module Adva::<%= name.classify %>::Paths | ||
def path_to(page) | ||
case page | ||
when 'path/to/<%= name %>' | ||
else | ||
super | ||
end | ||
end | ||
end | ||
World(Adva::<%= name.classify %>::Paths) | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
adva-core/lib/adva/generators/templates/engine/test_helper.rb.erb
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,3 @@ | ||
require File.expand_path('../../../adva-core/test/test_helper', __FILE__) | ||
require File.expand_path('../../../test/test_helper', __FILE__) | ||
|
||
require 'adva-<%= name %>' |
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,18 +1,20 @@ | ||
module GlobalHelpers | ||
|
||
def site | ||
Site.first || raise("Could not find a site. Maybe you want to set one up in your story background?") | ||
end | ||
|
||
def user | ||
@user || raise("@current_user is not set. Maybe you want to sign in first?") | ||
end | ||
|
||
def account | ||
Account.first || raise("Could not find a site. Maybe you want to set one up in your story background?") | ||
end | ||
|
||
def parsed_html | ||
# memoizing this causes problems since it seems to be memoized across requests | ||
# TODO: Figure out way to memoize within one request only | ||
# @parsed_body ||= Nokogiri::HTML(response.body) | ||
Nokogiri::HTML(response.body) | ||
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 |
---|---|---|
|
@@ -32,4 +32,4 @@ def setup | |
def teardown | ||
DatabaseCleaner.clean | ||
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,2 +1,2 @@ | ||
require File.expand_path('../../../adva-core/lib/testing/env', __FILE__) | ||
require File.expand_path('../../../features/env', __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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
require File.expand_path('../../../adva-core/test/test_helper', __FILE__) | ||
require File.expand_path('../../../test/test_helper', __FILE__) | ||
|
||
|
||
require 'adva-markup' |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
require File.expand_path('../../../adva-core/test/test_helper', __FILE__) | ||
require File.expand_path('../../../test/test_helper', __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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require File.expand_path('../../../adva-core/lib/testing/env', __FILE__) | ||
require File.expand_path('../../../features/env', __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
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,2 @@ | ||
require File.expand_path('../../adva-core/lib/testing/env', __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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require File.expand_path('../../adva-core/test/test_helper', __FILE__) | ||
|
||
|