Sha256: 3f5cb10cb39abc41d83fed8dfbef5997fca6bb5cae8fdad0be7ff4d133eed1fc

Contents?: true

Size: 1.42 KB

Versions: 12

Compression:

Stored size: 1.42 KB

Contents

#FIXME - this shouldn't really be with the controller specs

describe CardController, "location test from old integration" do

  include Wagn::Location

  before do
    login_as 'joe_user'
  end

  it "should test_previous_location_should_be_assigned_after_viewing" do
    get :read, :id=>"Joe_User"
    assert_equal "/Joe_User", assigns['previous_location']
  end

  it "should test_previous_location_should_not_be_updated_by_nonexistent_card" do
    get :read, :id=>"Joe_User"
    get :read, :id=>"Not_Me"
    get :read, :id=>'*previous'
    assert_redirected_to '/Joe_User'
  end

  it "should test_return_to_special_url_when_logging_in_after_visit" do
    # not sure this still tests the case, controller tests do not test routes
    get :read, :id=>'*recent'
    assert_equal "/*recent",  assigns['previous_location']
  end

  # FIXME: this should probably be files in the spot for a delete test
  it "should test_removal_and_return_to_previous_undeleted_card_after_deletion" do
    t1 = t2 = nil
    Card::Auth.as_bot do
      t1 = Card.create! :name => "Testable1", :content => "hello"
      t2 = Card.create! :name => "Testable1+bandana", :content => "world"
    end

    get :read, :id => t1.key
    get :read, :id => t2.key

    post :delete, :id=> '~'+t2.id.to_s
    assert_nil Card[ t2.name ]
    assert_redirected_to "/#{t1.name}"

    post :delete, :id => '~'+t1.id.to_s
    assert_redirected_to '/'
    assert_nil Card[ t1.name ]
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
wagn-1.14.4 spec/controllers/location_spec.rb
wagn-1.14.3 spec/controllers/location_spec.rb
wagn-1.14.2 spec/controllers/location_spec.rb
wagn-1.14.1 spec/controllers/location_spec.rb
wagn-1.14.0 spec/controllers/location_spec.rb
wagn-1.14.0.pre3 spec/controllers/location_spec.rb
wagn-1.14.0.pre2 spec/controllers/location_spec.rb
wagn-1.14.0.pre1 spec/controllers/location_spec.rb
wagn-1.13.0 spec/controllers/location_spec.rb
wagn-1.13.0.pre2 spec/controllers/location_spec.rb
wagn-1.13.0.pre1 spec/controllers/location_spec.rb
wagn-1.13.0.pre spec/controllers/location_spec.rb