Sha256: 1c0eefaebe59303eb8b92913851b69a39435937ef47217e5168eed552ead78e5

Contents?: true

Size: 840 Bytes

Versions: 7

Compression:

Stored size: 840 Bytes

Contents

require 'test_helper'
require "wobapphelpers/responders.rb"

class FlashTest < ActionController::TestCase
  tests PostsController

  test "flash[notice] should be set with successful creation info" do
    post :create, params: { post: {subject: "Quark", body: "just a test"} }
    assert_equal "Posting erfolgreich erstellt.", flash[:notice]
  end

  test "flash[notice] should be set with successful update info" do
    post = Post.create!(subject: "Memo")
    put :update, params: { id: post.id, post: { body: "just a test"} }
    assert_equal "Posting erfolgreich aktualisiert.", flash[:notice]
  end

  test "flash[notice] should be set with successful deletion message" do
    post = Post.create!(subject: "Memo")
    delete :destroy, params: { id: post.id }
    assert_equal "Posting erfolgreich gelöscht.", flash[:notice]
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wobapphelpers-4.2.0 test/responders/flash_test.rb
wobapphelpers-4.1.2 test/responders/flash_test.rb
wobapphelpers-4.1.1 test/responders/flash_test.rb
wobapphelpers-4.1.0 test/responders/flash_test.rb
wobapphelpers-4.0.0 test/responders/flash_test.rb
wobapphelpers-3.1.1 test/responders/flash_test.rb
wobapphelpers-3.1.0 test/responders/flash_test.rb