Sha256: 96abfb661b91354d7eb4a3c3214043d16d3964f6795d6b167911949d3301028c

Contents?: true

Size: 999 Bytes

Versions: 7

Compression:

Stored size: 999 Bytes

Contents

require 'test_helper'

module Spina
  module Admin
    class PagesTest < ActionDispatch::IntegrationTest
      setup do
        @routes = Engine.routes
        post_via_redirect "/admin/sessions", email: spina_users(:bram).email, password: "password"
      end

      test "new page form" do
        get "/admin/pages/new"
        assert_select '#new_page'
      end

      test "create new page" do
        post_via_redirect "/admin/pages", page: {title: "A new page"}
        assert_select '.breadcrumbs', text: /A\snew\spage\z/
      end

      test "create new page without title" do
        post_via_redirect "/admin/pages", page: {title: nil}
        assert_select '#error_explanation'
      end

      test "create concept page" do
        post_via_redirect "/admin/pages", page: {title: "A new page", draft: true}
        assert_select '.breadcrumbs', text: /A\snew\spage\z/
        get "/admin/pages"
        assert_select '.dd-item-inner small', text: '(draft)'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spina-0.8.3 test/integration/spina/admin/pages_test.rb
spina-0.8.2 test/integration/spina/admin/pages_test.rb
spina-0.8.1 test/integration/spina/admin/pages_test.rb
spina-0.8.0 test/integration/spina/admin/pages_test.rb
spina-0.7.3 test/integration/spina/admin/pages_test.rb
spina-0.7.2 test/integration/spina/admin/pages_test.rb
spina-0.7.0 test/integration/spina/admin/pages_test.rb