mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2025-04-20 07:11:33 +02:00
Start with a Rails app with authentication via Persona, Foundation CSS
This commit is contained in:
parent
9ac52066b4
commit
7cd9f207f5
72 changed files with 2586 additions and 0 deletions
0
test/controllers/.keep
Normal file
0
test/controllers/.keep
Normal file
7
test/controllers/search_controller_test.rb
Normal file
7
test/controllers/search_controller_test.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class SearchControllerTest < ActionController::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
7
test/controllers/sessions_controller_test.rb
Normal file
7
test/controllers/sessions_controller_test.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class SessionsControllerTest < ActionController::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
0
test/fixtures/.keep
vendored
Normal file
0
test/fixtures/.keep
vendored
Normal file
11
test/fixtures/users.yml
vendored
Normal file
11
test/fixtures/users.yml
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
# This model initially had no columns defined. If you add columns to the
|
||||
# model remove the '{}' from the fixture names and add the columns immediately
|
||||
# below each fixture, per the syntax in the comments below
|
||||
#
|
||||
one: {}
|
||||
# column: value
|
||||
#
|
||||
two: {}
|
||||
# column: value
|
0
test/helpers/.keep
Normal file
0
test/helpers/.keep
Normal file
0
test/integration/.keep
Normal file
0
test/integration/.keep
Normal file
24
test/integration/authentication_test.rb
Normal file
24
test/integration/authentication_test.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AuthenticationTest < ActionDispatch::IntegrationTest
|
||||
test 'register via first time sign in and sign out' do
|
||||
visit '/auth/developer'
|
||||
fill_in 'Name', with: 'me'
|
||||
fill_in 'Email', with: 'user@example.com'
|
||||
click_button 'Sign In'
|
||||
assert_equal '/', current_path
|
||||
assert_is_signed_in
|
||||
|
||||
click_link 'Abmelden'
|
||||
assert_equal '/', current_path
|
||||
assert_is_signed_out
|
||||
end
|
||||
|
||||
def assert_is_signed_in
|
||||
assert_equal 'Abmelden', find('[data-logout]').text
|
||||
end
|
||||
|
||||
def assert_is_signed_out
|
||||
assert_equal 'Anmelden', find('[data-persona-login]').text
|
||||
end
|
||||
end
|
0
test/mailers/.keep
Normal file
0
test/mailers/.keep
Normal file
0
test/models/.keep
Normal file
0
test/models/.keep
Normal file
7
test/models/user_test.rb
Normal file
7
test/models/user_test.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
require 'test_helper'
|
||||
|
||||
class UserTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
16
test/test_helper.rb
Normal file
16
test/test_helper.rb
Normal file
|
@ -0,0 +1,16 @@
|
|||
ENV['RAILS_ENV'] ||= 'test'
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/test_help'
|
||||
require 'capybara/rails'
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
||||
fixtures :all
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
end
|
||||
|
||||
class ActionDispatch::IntegrationTest
|
||||
# Make the Capybara DSL available in all integration tests
|
||||
include Capybara::DSL
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue