We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae7dbad commit 8f3ca51Copy full SHA for 8f3ca51
app/controllers/payments_controller.rb
@@ -1,4 +1,6 @@
1
class PaymentsController < ApplicationController
2
+ before_action :is_logged_in?
3
+
4
def new; end
5
6
def create
spec/features/payments_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+RSpec.feature 'Payments', type: :feature do
+ context 'a visitor to the website' do
+ scenario 'cannot access the payments page' do
+ visit new_payment_path
7
8
+ expect(page).to have_content('You must be logged in to access this page')
9
+ end
10
11
12
+ context 'a logged in user' do
13
+ let(:member) { Fabricate(:member) }
14
15
+ before do
16
+ login(member)
17
18
19
+ scenario 'can access the payments page' do
20
21
22
+ expect(page).to have_content('Payments')
23
24
25
+end
0 commit comments