Skip to content

Commit

Permalink
Starting minimal features test
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored Apr 6, 2021
1 parent 99e0157 commit 5b29f06
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/integration/features_test.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5b29f06

Please sign in to comment.