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