-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Showing
7 changed files
with
111 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require File.expand_path("../../spec/spec_helper.rb", __FILE__) | ||
|
||
# Put your acceptance spec helpers inside spec/acceptance/support | ||
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} | ||
|
||
# Workaround for ActionDispatch::ClosedError | ||
# https://github.com/binarylogic/authlogic/issues/262#issuecomment-1804988 | ||
User.acts_as_authentic_config[:maintain_sessions] = false | ||
|
||
if ENV['HEADLESS'] == 'true' | ||
require 'headless' | ||
headless = Headless.new | ||
headless.start | ||
HEADLESS_DISPLAY = ":#{headless.display}" | ||
at_exit do | ||
headless.destroy | ||
end | ||
puts "Running in Headless mode. Display #{HEADLESS_DISPLAY}" | ||
end | ||
|
||
# Default timeout for extended for AJAX based application | ||
Capybara.default_wait_time = 7 |
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,30 @@ | ||
require File.expand_path("../acceptance_helper.rb", __FILE__) | ||
|
||
feature 'Accounts feature', %q{ | ||
In order to increase customer satisfaction | ||
As a user | ||
I want to manage accounts | ||
} do | ||
|
||
before(:each) do | ||
do_login | ||
end | ||
|
||
scenario 'should view a list of accounts' do | ||
2.times { |i| Factory(:account, :name => "Account #{i}") } | ||
visit accounts_path | ||
page.should have_content('Account 0') | ||
page.should have_content('Account 1') | ||
page.should have_content('Search accounts') | ||
page.should have_content('Create Account') | ||
end | ||
|
||
#scenario 'should create a new account', :js => true do | ||
#visit accounts_path | ||
#click_link "Create Account" | ||
#fill_in 'account_name', :with => "My new account" | ||
#click_button 'Create Account' | ||
#page.should have_content('My new account') | ||
#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,14 @@ | ||
module HelperMethods | ||
# Put helper methods you need to be available in all acceptance specs here. | ||
|
||
def do_login(args = {}) | ||
user = Factory(:user, args) | ||
visit '/login' | ||
fill_in "authentication_username", :with => user.username | ||
fill_in "authentication_password", :with => user.password | ||
click_button "Login" | ||
end | ||
|
||
end | ||
|
||
RSpec.configuration.include HelperMethods, :type => :acceptance |
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 @@ | ||
module NavigationHelpers | ||
# Put helper methods related to the paths in your application here. | ||
|
||
def homepage | ||
"/" | ||
end | ||
end | ||
|
||
RSpec.configuration.include NavigationHelpers, :type => :acceptance |
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