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
62555d3
commit e4b571c
Showing
5 changed files
with
81 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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
guard 'rspec', :version => 2 do | ||
watch(%r{^spec/.+_spec\.rb$}) | ||
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } | ||
watch('spec/spec_helper.rb') { "spec" } | ||
|
||
# Rails example | ||
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } | ||
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } | ||
watch(%r{^spec/support/(.+)\.rb$}) { "spec" } | ||
watch('config/routes.rb') { "spec/routing" } | ||
watch('app/controllers/application_controller.rb') { "spec/controllers" } | ||
# Capybara request specs | ||
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } | ||
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,35 @@ | ||
module BetaInvite | ||
|
||
class Feature | ||
|
||
attr_reader :path | ||
|
||
def initialize(path) | ||
@path = path | ||
end | ||
|
||
def name | ||
self.source[/^Feature: (.+)$/, 1] || name_lines.first.split(':', 2).second.strip | ||
end | ||
|
||
def to_param | ||
relative_path.sub(/^\//, '').sub(/\.feature$/, '') | ||
end | ||
|
||
def source | ||
File.read(@path).to_s | ||
end | ||
|
||
def ==(other) | ||
to_param == other.to_param | ||
end | ||
|
||
private | ||
|
||
def relative_path | ||
File.expand_path(path).sub(Courgette.feature_root, '') | ||
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FactoryGirl.define :beta_invite do |f| | ||
f.sequence(:email) {|n| "foo#{n}@example.com"} | ||
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,17 @@ | ||
require 'spec_helper' | ||
|
||
include Capybara::DSL | ||
describe "Task" do | ||
describe "SendBetaInvite" do | ||
it "saves users email for the beta invitation" do | ||
#beta_invite = FactoryGirl.build(:beta_invite) | ||
visit '/' | ||
#click_link "password" | ||
fill_in "beta_invite[recipient_email]", :with => "crap123@gmail.com" | ||
click_button "Get Invited" | ||
current_path.should eq(root_path) | ||
page.should have_content("Thank you for signing up with us. We will keep you updated.") | ||
#last_email.to.should include(user.email) | ||
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
require 'capybara/rails' | ||
|
||
RSpec.configure do |config| | ||
# ... | ||
#config.include(MailerMacros) | ||
#config.before(:each) { reset_email } | ||
end |