/etc/default/grub => get back to terminal messages
/etc/systemd/system.conf => limit start-/stop-jobs to 3s
## Context + metadata | |
shared_context 'Logged as a user', role: true do | |
let(:user) { |example| create :user, example.metadata[:role] } | |
before { login_as user } | |
end | |
scenario "Login as a client", role: :client | |
scenario "Login as a customer", role: :customer | |
scenario "Login as an admin", role: :admin |
# Rake task to help migrating a rails 3 app to rails 4 strong_parameters. | |
# The task generates source code for helper methods for each model class | |
# to 'permit' the attributes. | |
# The generated methods are intended as starting point to copy&paste in the | |
# controller and than edit the permitted attributs. | |
# Some common names of non-editable attributes are already filtered, | |
# like 'id', 'password' or 'created_at'. | |
# The output is written to stdout so you can pipe it into a file | |
# | |
# Dependencies: |
describe PostPolicy do | |
let(:scope) { Post.where(:published => true } | |
subject(:policy_scope) { PostPolicy::Scope.new(user, scope).resolve } | |
permissions ".scope" do | |
context "for an ordinary user" | |
let(:user) { User.new(:admin => false) } | |
it "hides unpublished post" do | |
post = Post.create(:published => false) |
require 'will_paginate/array' | |
describe "recurrences/index" do | |
let(:recurrences) do [ | |
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-05"), | |
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-12"), | |
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-19") | |
] | |
end | |
require 'will_paginate/array' | |
describe "recurrences/index" do | |
let(:recurrences) do [ | |
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-05"), | |
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-12"), | |
FactoryGirl.build(:recurrence, scheduled_to: "2012-07-19") | |
] | |
end |
namespace :db do | |
desc "load data from csv" | |
task :load_csv_data => :environment do | |
require 'fastercsv' | |
FasterCSV.foreach("importdata/tarife.csv", :headers => true, :col_sep => ',') do |row| | |
Anbieter.find_or_create_by_name( | |
:name => row['Anbieter_Name'] | |
:hotline => row['Hotline'], | |
:email => row['Email'] |