-
-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added rspec+capybara and wrote events spec
- Loading branch information
Showing
5 changed files
with
113 additions
and
0 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
--colour |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
require 'spec_helper' | |||
|
|||
describe "Events" do | |||
|
|||
it "should create a new event" do | |||
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers | |||
visit events_path | |||
click_link "New Event" | |||
|
|||
fill_in "Title", :with=>"February Event" | |||
select "February",:from =>"event[date(2i)]" | |||
click_button "Create Event" | |||
|
|||
page.should have_content("February Event") | |||
page.should have_content("This event currently has no location!") | |||
|
|||
visit events_path | |||
|
|||
page.should have_content("February Event") | |||
|
|||
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,42 @@ | |||
# This file is copied to spec/ when you run 'rails generate rspec:install' | |||
ENV["RAILS_ENV"] ||= 'test' | |||
require File.expand_path("../../config/environment", __FILE__) | |||
require 'rspec/rails' | |||
require 'rspec/autorun' | |||
require 'capybara/rspec' | |||
|
|||
# Requires supporting ruby files with custom matchers and macros, etc, | |||
# in spec/support/ and its subdirectories. | |||
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |||
|
|||
RSpec.configure do |config| | |||
# ## Mock Framework | |||
# | |||
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: | |||
# | |||
# config.mock_with :mocha | |||
# config.mock_with :flexmock | |||
# config.mock_with :rr | |||
|
|||
# If you're not using ActiveRecord, or you'd prefer not to run each of your | |||
# examples within a transaction, remove the following line or assign false | |||
# instead of true. | |||
config.use_transactional_fixtures = false | |||
|
|||
config.before(:suite) do | |||
DatabaseCleaner.strategy = :truncation | |||
end | |||
|
|||
config.before(:each) do | |||
DatabaseCleaner.start | |||
end | |||
|
|||
config.after(:each) do | |||
DatabaseCleaner.clean | |||
end | |||
|
|||
# If true, the base class of anonymous controllers will be inferred | |||
# automatically. This will be the default behavior in future versions of | |||
# rspec-rails. | |||
#config.infer_base_class_for_anonymous_controllers = false | |||
end |