<commit_before>require 'spec_helper'

feature %q{
  As a user
  I want to be able to RSVP
  So organizers can see how many people go
} do

  background do
    @user = FactoryGirl.create(:user)
    @lesson = FactoryGirl.create(:lesson)
    visit root_path
    click_link "Login"
    fill_in "user[email]", :with => @user.email
    fill_in "user[password]", :with => "<PASSWORD>"
    click_button "Sign in"
  end


  scenario "RSVP clicking RSVP button", :js => true do
    click_link "RSVP!"
    page.should have_css(".pressed")
    Attendance.all.count.should == 1
  end


end


feature %q{
  As a user
  I cannot RSVP if I am not logged in
  So organizers know who exactly goes
} do

  background do
    visit "/"
  end

  scenario "trying RSVP clicking RSVP button", :js => true do
    click_link "RSVP!"
    page.should_not have_css(".pressed")
    Attendance.all.count.should == 0
  end


end


feature %q{
  As a website
  I want to make sure,
  That when lesson is saved
  Slug is generated
} do

  background do
  end

  scenario "creating a lesson", :js => true do
    l = Lesson.new
    l.title = "Funny lesson how to eat bad veggie burgers"
    l.description = "Yooou!"
    l.save!
    lessons = Lesson.all
    lessons.count.should == 1
    lessons.first.slug.should == "funny_lesson_how_to_eat_bad_veggie_burgers"
  end


end

feature %q{
  As a website
  I want to make sure,
  That the admin can create lessons
  So the admin can create lessons
} do

  background do
    @admin = FactoryGirl.create(:admin)
    visit root_path
    click_link "Login"
    fill_in "user[email]", :with => @admin.email
    fill_in "user[password]", :with => "<PASSWORD>"
    click_button "Sign in"
  end

  scenario "creating a lesson", :js => true do
    visit "/lessons/new"
    fill_in "lesson[title]", :with => "some random topic"
    fill_in "lesson[description]", :with => "some random topic"
    click_button "Save"
    lessons = Lesson.all
    lessons.count.should == 1
  end


end

feature %q{
  As a website
  I want to make sure,
  That some random user
  Can't create lessons
} do

  background do
    @user = FactoryGirl.create(:user)
    visit root_path
    click_link "Login"
    fill_in "user[email]", :with => @user.email
    fill_in "user[password]", :with => "<PASSWORD>"
    click_button "Sign in"
  end

  scenario "Random user is trying to access create lesson address", :js => true do
    visit new_lesson_path
    uri = URI.parse(current_url)
    uri.path.should == root_path
  end


end


feature %q{
  As an admin
  I want to make sure
  When I create a lesson, slug also is generated
} do

  background do
    @user = FactoryGirl.create(:user)
    @lesson = FactoryGirl.create(:lesson)
    visit root_path
    click_link "Login"
    fill_in "user[email]", :with => @user.email
    fill_in "user[password]", :with => "<PASSWORD>"
    click_button "Sign in"
  end


  scenario "RSVP clicking RSVP button", :js => true do
    @lesson.save!
    Lesson.first.slug.should == "some-random-lesson-how-to-make-animal-orgy-on-mondays"
  end


end<commit_msg>tests passing<commit_after>require 'spec_helper'

feature %q{
  As a user
  I want to be able to RSVP
  So organizers can see how many people go
} do

  background do
    @user = FactoryGirl.create(:user)
    @lesson = FactoryGirl.create(:lesson)
    visit root_path
    click_link "Login"
    fill_in "user[email]", :with => @user.email
    fill_in "user[password]", :with => "<PASSWORD>"
    click_button "Sign in"
  end


  scenario "RSVP clicking RSVP button", :js => true do
    click_link "RSVP!"
    page.should have_css(".pressed")
    Attendance.all.count.should == 1
  end


end


feature %q{
  As a user
  I cannot RSVP if I am not logged in
  So organizers know who exactly goes
} do

  background do
    @lesson = FactoryGirl.create(:lesson)
    visit "/"
  end

  scenario "trying RSVP clicking RSVP button", :js => true do
    click_link "RSVP!"
    page.should_not have_css(".pressed")
    Attendance.all.count.should == 0
  end


end


feature %q{
  As a website
  I want to make sure,
  That when lesson is saved
  Slug is generated
} do

  background do
  end

  scenario "creating a lesson", :js => true do
    l = Lesson.new
    l.title = "Funny lesson how to eat bad veggie burgers"
    l.description = "Yooou!"
    l.save!
    lessons = Lesson.all
    lessons.count.should == 1
    lessons.first.slug.should == "funny-lesson-how-to-eat-bad-veggie-burgers"
  end


end

feature %q{
  As a website
  I want to make sure,
  That the admin can create lessons
  So the admin can create lessons
} do

  background do
    @admin = FactoryGirl.create(:admin)
    visit root_path
    click_link "Login"
    fill_in "user[email]", :with => @admin.email
    fill_in "user[password]", :with => "<PASSWORD>"
    click_button "Sign in"
  end

  scenario "creating a lesson", :js => true do
    visit "/lessons/new"
    fill_in "lesson[title]", :with => "some random topic"
    fill_in "lesson[description]", :with => "some random topic"
    click_button "Save"
    lessons = Lesson.all
    lessons.count.should == 1
  end


end

feature %q{
  As a website
  I want to make sure,
  That some random user
  Can't create lessons
} do

  background do
    @user = FactoryGirl.create(:user)
    visit root_path
    click_link "Login"
    fill_in "user[email]", :with => @user.email
    fill_in "user[password]", :with => "<PASSWORD>"
    click_button "Sign in"
  end

  scenario "Random user is trying to access create lesson address", :js => true do
    visit new_lesson_path
    uri = URI.parse(current_url)
    uri.path.should == root_path
  end


end

{'fraction_non_alphanumeric': 0.10414074995557135, 'fraction_numerical': 0.0014217167229429537, 'mean_word_length': 3.0, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 39, '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': '3928701', 'n_tokens_mistral': 1934, 'n_tokens_neox': 1878, 'n_words': 629}