<commit_before># encoding: utf-8

require 'test_helper'

class SingleEventsControllerTest < ActionController::TestCase
  include Devise::TestHelpers

  test "should be successful" do
    single_event = FactoryGirl.create(:single_event)
    get :show, :id => single_event.id, :event_id => single_event.event.id
    assert_response :success
  end

  test "should render the comments partial in order to show and post comments" do
    single_event = FactoryGirl.create(:single_event)
    get :show, :id => single_event.id, :event_id => single_event.event.id
    assert_template("_comments")
  end

  test "should not be able to edit if not bodo" do
    single_event = FactoryGirl.create(:single_event)
    get :edit, :id => single_event.id, :event_id => single_event.event.id
    sign_in FactoryGirl.create(:user)

    assert_redirected_to :controller => 'welcome', :action => 'index'
  end

  test "should be able to edit if bodo" do
    single_event = FactoryGirl.create(:single_event)
    get :edit, :id => single_event.id, :event_id => single_event.event.id
    sign_in FactoryGirl.create(:bodo)

    assert_response :success

    put :update, :id => single_event.id, :event_id => single_event.event.id, :single_event => {:topic => "Something new"}
    single_event.reload
    assert_match /Something new.+/, single_event.name
  end
end<commit_msg>Logged in to late in the test, #37<commit_after># encoding: utf-8

require 'test_helper'

class SingleEventsControllerTest < ActionController::TestCase
  include Devise::TestHelpers

  test "should be successful" do
    single_event = FactoryGirl.create(:single_event)
    get :show, :id => single_event.id, :event_id => single_event.event.id
    assert_response :success
  end

  test "should render the comments partial in order to show and post comments" do
    single_event = FactoryGirl.create(:single_event)
    get :show, :id => single_event.id, :event_id => single_event.event.id
    assert_template("_comments")
  end

  test "should not be able to edit if not bodo" do
    single_event = FactoryGirl.create(:single_event)
    sign_in FactoryGirl.create(:user)
    get :edit, :id => single_event.id, :event_id => single_event.event.id

    assert_redirected_to :controller => 'welcome', :action => 'index'
  end

  test "should be able to edit if bodo" do
    single_event = FactoryGirl.create(:single_event)
    sign_in FactoryGirl.create(:bodo)
    get :edit, :id => single_event.id, :event_id => single_event.event.id

    assert_response :success

    put :update, :id => single_event.id, :event_id => single_event.event.id, :single_event => {:topic => "Something new"}
    single_event.reload
    assert_match /Something new.+/, single_event.name
  end
end
{'fraction_non_alphanumeric': 0.10665685913938948, 'fraction_numerical': 0.001471129091577786, 'mean_word_length': 4.250965250965251, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5388739', 'n_tokens_mistral': 866, 'n_tokens_neox': 838, 'n_words': 236}