mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-27 01:08:30 -04:00
Explicitly add spec for notification
This commit is contained in:
1 parent
de26dd3708
commit
a69210ae6b
1 file changed
+12
-3
@@ -2,10 +2,9 @@ require 'spec_helper'
|
||||
|
||||
feature "signin" do
|
||||
let(:member){FactoryGirl.create(:member)}
|
||||
let(:recipient){FactoryGirl.create(:member)}
|
||||
let(:notification){FactoryGirl.create(:notification)}
|
||||
|
||||
MODELS = [:plantings, :harvests, :posts, :photos, :gardens, :seeds]
|
||||
|
||||
scenario "redirect to previous page after signin" do
|
||||
visit crops_path # some random page
|
||||
click_link 'Sign in'
|
||||
@@ -30,7 +29,8 @@ feature "signin" do
|
||||
end
|
||||
|
||||
scenario "after signin, redirect to what you were trying to do" do
|
||||
MODELS.each do |model|
|
||||
models = %w[plantings harvests posts photos gardens seeds]
|
||||
models.each do |model|
|
||||
visit "/#{model}/new"
|
||||
current_path.should eq new_member_session_path
|
||||
fill_in 'Login', with: member.login_name
|
||||
@@ -41,4 +41,13 @@ feature "signin" do
|
||||
end
|
||||
end
|
||||
|
||||
scenario "after signin, redirect to new notifications page" do
|
||||
visit new_notification_path(recipient: recipient)
|
||||
current_path.should eq new_member_session_path
|
||||
fill_in 'Login', with: member.login_name
|
||||
fill_in 'Password', with: member.password
|
||||
click_button 'Sign in'
|
||||
current_path.should eq new_notification_path
|
||||
end
|
||||
|
||||
end
|
||||
Reference in new issue
Block a user