From 5b29f065b122233e6171f2eca6e094c989787f37 Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Tue, 6 Apr 2021 11:36:34 -0400 Subject: [PATCH] Starting minimal features test re #9416 --- test/integration/features_test.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/integration/features_test.rb diff --git a/test/integration/features_test.rb b/test/integration/features_test.rb new file mode 100644 index 0000000000..bd771db1eb --- /dev/null +++ b/test/integration/features_test.rb @@ -0,0 +1,23 @@ +require 'test_helper' + +class FeaturesTest < ActionDispatch::IntegrationTest + test 'admins may update features' do + u = users(:admin) + post '/user_sessions', params: { user_session: { username: u.username, password: 'secretive' } } + + get '/features/new' + + assert_response :success + + post '/features/create', params: { + title: 'new-feature', + body: 'This is a new feature!' + } + + follow_redirect! + assert_equal '/features/?_=' + + Time.now.strftime('%m-%d-%Y'), path + + assert Node.where(type: 'feature').last.title = 'new-feature' + end +end