From 7f710ec72d85ec13e18f1f9e8bf57ef47867d6bf Mon Sep 17 00:00:00 2001 From: KalabiYau Date: Fri, 4 Jul 2014 22:26:51 +0200 Subject: [PATCH 01/15] There is no common logger in model namespace --- app/models/conference.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/models/conference.rb b/app/models/conference.rb index 20825c16..e5681ed4 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -115,7 +115,6 @@ class Conference < ActiveRecord::Base return nil if user.nil? if registrations.where(user_id: user.id).count == 0 - logger.debug("User #{user.email} isn't registered to self.title") return false else return true From dbb210908b68a3c5ea9ecb1d6ce51849af4aac6e Mon Sep 17 00:00:00 2001 From: KalabiYau Date: Fri, 4 Jul 2014 22:35:47 +0200 Subject: [PATCH 02/15] Update and fix test kitchet to be conformant with poltergeist --- .../admin/conferences_controller_spec.rb | 6 ++- spec/features/sponsor_spec.rb | 4 +- spec/features/volunteers_spec.rb | 5 +- spec/spec_helper.rb | 54 ++++++++++++------- spec/support/kneet_connections.rb | 10 ++++ spec/support/login_macros.rb | 17 +++--- 6 files changed, 62 insertions(+), 34 deletions(-) create mode 100644 spec/support/kneet_connections.rb diff --git a/spec/controllers/admin/conferences_controller_spec.rb b/spec/controllers/admin/conferences_controller_spec.rb index 961f6463..d1845584 100644 --- a/spec/controllers/admin/conferences_controller_spec.rb +++ b/spec/controllers/admin/conferences_controller_spec.rb @@ -13,11 +13,15 @@ describe Admin::ConferenceController do let(:participant) { create(:participant) } shared_examples 'access as administration or organizer' do + describe 'PATCH #update' do + context 'valid attributes' do + it 'locates the requested conference' do patch :update, id: conference.short_title, conference: attributes_for(:conference, title: 'Example Con') + expect(assigns(:conference)).to eq(conference) end @@ -192,7 +196,7 @@ describe Admin::ConferenceController do describe 'administrator access' do - before(:each) do + before do sign_in(admin) end diff --git a/spec/features/sponsor_spec.rb b/spec/features/sponsor_spec.rb index b6678668..24998340 100644 --- a/spec/features/sponsor_spec.rb +++ b/spec/features/sponsor_spec.rb @@ -12,6 +12,7 @@ feature Sponsor do conference = create(:conference) conference.sponsorship_levels << create(:sponsorship_level, conference: conference) sign_in create(user) + visit admin_conference_sponsors_path( conference_id: conference.short_title) # Add sponsors @@ -36,6 +37,7 @@ feature Sponsor do find(:css, "select[id^='conference_sponsors_attributes_']"\ "[id$='_sponsorship_level_id']"). find(:option, 'Platin').select_option + click_button 'Update Conference' expect(flash).to eq('Sponsorships were successfully updated.') @@ -55,7 +57,7 @@ feature Sponsor do value).to eq('http://www.example.com') expect(find('div.nested-fields:nth-of-type(1)'\ - ' div:nth-of-type(5) select:nth-of-type(1)'). + ' div:nth-of-type(5) select:nth-of-type(1)').find('option[selected]'). text).to eq('Platin') # Remove sponsor diff --git a/spec/features/volunteers_spec.rb b/spec/features/volunteers_spec.rb index df696adf..bc1e6d76 100644 --- a/spec/features/volunteers_spec.rb +++ b/spec/features/volunteers_spec.rb @@ -103,9 +103,10 @@ feature Conference do expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\ ' div:nth-of-type(2) textarea'). value).to eq('Example Description') + expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\ - ' div:nth-of-type(3) select:nth-of-type(1)'). - text).to eq("#{Date.today.strftime}") + ' div:nth-of-type(3) select:nth-of-type(1)').find('option[selected]'). + text).to eq(Date.today.strftime) # Remove vposition click_link 'Remove vposition' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0776c1b8..f6f3859f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,12 @@ ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) require 'rspec/rails' +# To avoid confusion on missed migrations - use Rails 4 checker to ensure +# all migrations applied +ActiveRecord::Migration.maintain_test_schema! + +# Add poltergeist to use it as JS driver +require 'capybara/poltergeist' # Requires supporting ruby files with custom matchers and macros, etc, in # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are @@ -24,9 +30,6 @@ RSpec.configure do |config| # config.mock_with :flexmock # config.mock_with :rr - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. @@ -38,33 +41,44 @@ RSpec.configure do |config| # --seed 1234 config.order = 'random' - # Include factory_girls syntax + # Setting up DB cleaning to maintain empty rows + config.before(:suite) do + DatabaseCleaner.strategy = :transaction + DatabaseCleaner.clean_with(:truncation) + end + + config.around(:each) do |example| + DatabaseCleaner.cleaning do + example.run + end + end + + # poltergeist as a underlying mech for Capybara + Capybara.javascript_driver = :poltergeist + + # Includes helpers and connect them to specific types of tests config.include FactoryGirl::Syntax::Methods - - # Enables devise sign_in function + config.include OmniauthMacros config.include Devise::TestHelpers, type: :controller - - # Enables devise sign_in function - config.include Devise::TestHelpers, type: :view - - # Use capybara-webkit as default javascript driver - Capybara.javascript_driver = :webkit - - # Includes support/login_macros for feature tests config.include LoginMacros, type: :feature - - # Includes omniauth macro - config.include(OmniauthMacros) - - # Includes support/flash for feature tests config.include Flash, type: :feature - config.include Sidebar, type: :view + config.include Devise::TestHelpers, type: :view # As we start from scratch in April 2014, let's forbid the old :should syntax config.expect_with :rspec do |c| c.syntax = :expect end + + config.use_transactional_fixtures = true + + # Reuse rspec as mocking framework + config.mock_framework = :rspec + + # Types of tests (controller, feature, model) will + # be inferred from subfolder name + config.infer_spec_type_from_file_location! + end OmniAuth.config.test_mode = true diff --git a/spec/support/kneet_connections.rb b/spec/support/kneet_connections.rb new file mode 100644 index 00000000..7de8cc59 --- /dev/null +++ b/spec/support/kneet_connections.rb @@ -0,0 +1,10 @@ +class ActiveRecord::Base + mattr_accessor :shared_connection + @@shared_connection = nil + + def self.connection + @@shared_connection || retrieve_connection + end +end + +ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection diff --git a/spec/support/login_macros.rb b/spec/support/login_macros.rb index 1bff7302..e8f22147 100644 --- a/spec/support/login_macros.rb +++ b/spec/support/login_macros.rb @@ -1,17 +1,14 @@ module LoginMacros + + include Warden::Test::Helpers + Warden.test_mode! + def sign_in(user) - visit new_user_session_path - - fill_in 'user_email', with: user.email - fill_in 'user_password', with: user.password - find(:xpath, "//div[@id='content']//button[@type='submit']").click - - expect(page.has_content?('Signed in successfully')).to be true + login_as(user, :scope => :user) end def sign_out - Capybara.current_session.driver.browser.clear_cookies - visit root_path - expect(page.has_content?('Sign In')).to be true + logout(:user) end + end From 158a9fe7a847f998372938f1e601ca5e4ec4ad19 Mon Sep 17 00:00:00 2001 From: KalabiYau Date: Fri, 4 Jul 2014 22:36:28 +0200 Subject: [PATCH 03/15] Add poltergeist, therubyracer, reshuffle Gemfile to be more lean --- Gemfile | 25 ++++++++++++---------- Gemfile.lock | 59 ++++++++++++++++++++++++++++------------------------ 2 files changed, 46 insertions(+), 38 deletions(-) diff --git a/Gemfile b/Gemfile index b2d66d8f..ef5a4bf3 100644 --- a/Gemfile +++ b/Gemfile @@ -67,8 +67,6 @@ gem 'axlsx_rails' gem 'd3_rails' gem 'chart-js-rails' -# We use coveralls for measuring test coverage -gem 'coveralls', require: false # Use a self-hosted errbit with the old notifier gem 'hoptoad_notifier', '~> 2.3' @@ -84,15 +82,8 @@ gem 'font-awesome-rails' #Use Redcarpet for Markdown in description gem 'redcarpet' -# Use rspec and capybara as testing framework -group :development, :test do - gem 'rspec', '>= 3.0.0.beta' - gem 'rspec-rails', '>= 3.0.0.beta' - gem 'capybara' - gem 'database_cleaner' - gem 'capybara-webkit' - gem 'shoulda' -end +# Rubyracer is JavaScript Runtime of choice +gem 'therubyracer' # FIXME: We should use http://weblog.rubyonrails.org/2012/3/21/strong-parameters/ gem 'protected_attributes' @@ -121,3 +112,15 @@ group :development do # Use letter_opener to open mails in development gem 'letter_opener' end + +# Use rspec and capybara as testing framework +group :test do + # We use coveralls for measuring test coverage + gem 'coveralls', require: false + gem 'rspec-rails' + gem 'capybara' + gem 'database_cleaner' + gem 'poltergeist' + # Set of rails validations matchers to describe models + gem 'shoulda' +end diff --git a/Gemfile.lock b/Gemfile.lock index 4a8f57d1..597b895c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -68,9 +68,6 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) xpath (~> 2.0) - capybara-webkit (1.1.1) - capybara (~> 2.0, >= 2.0.2) - json celluloid (0.15.2) timers (~> 1.1.0) celluloid-io (0.15.0) @@ -80,6 +77,7 @@ GEM railties (> 3.1) climate_control (0.0.3) activesupport (>= 3.0) + cliver (0.3.2) cocaine (0.5.4) climate_control (>= 0.0.3, < 1.0) cocoon (1.2.6) @@ -99,7 +97,7 @@ GEM thor d3_rails (3.4.6) railties (>= 3.1.0) - database_cleaner (1.2.0) + database_cleaner (1.3.0) devise (3.2.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -166,6 +164,7 @@ GEM addressable (~> 2.3) letter_opener (1.2.0) launchy (~> 2.2) + libv8 (3.16.14.3) listen (2.7.2) celluloid (>= 0.15.2) celluloid-io (>= 0.15.0) @@ -222,6 +221,11 @@ GEM ast (>= 1.1, < 3.0) slop (~> 3.4, >= 3.4.5) pdf-core (0.2.5) + poltergeist (1.5.1) + capybara (~> 2.1) + cliver (~> 0.3.1) + multi_json (~> 1.0) + websocket-driver (>= 0.2.0) polyglot (0.3.5) powerpack (0.0.9) prawn (1.0.0) @@ -274,34 +278,31 @@ GEM rdoc (~> 4.0) yajl-ruby (~> 1.1) redcarpet (3.1.2) + ref (1.0.5) referer-parser (0.2.1) request_store (1.0.6) rest-client (1.6.7) mime-types (>= 1.16) - rspec (3.0.0.beta2) - rspec-core (= 3.0.0.beta2) - rspec-expectations (= 3.0.0.beta2) - rspec-mocks (= 3.0.0.beta2) - rspec-collection_matchers (0.0.4) - rspec-expectations (>= 2.99.0.beta1) - rspec-core (3.0.0.beta2) - rspec-support (= 3.0.0.beta2) - rspec-expectations (3.0.0.beta2) + rspec (3.0.0) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-core (3.0.2) + rspec-support (~> 3.0.0) + rspec-expectations (3.0.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (= 3.0.0.beta2) - rspec-mocks (3.0.0.beta2) - rspec-support (= 3.0.0.beta2) - rspec-rails (3.0.0.beta2) + rspec-support (~> 3.0.0) + rspec-mocks (3.0.2) + rspec-support (~> 3.0.0) + rspec-rails (3.0.0) actionpack (>= 3.0) - activemodel (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-collection_matchers - rspec-core (= 3.0.0.beta2) - rspec-expectations (= 3.0.0.beta2) - rspec-mocks (= 3.0.0.beta2) - rspec-support (= 3.0.0.beta2) - rspec-support (3.0.0.beta2) + rspec-core (~> 3.0.0) + rspec-expectations (~> 3.0.0) + rspec-mocks (~> 3.0.0) + rspec-support (~> 3.0.0) + rspec-support (3.0.2) rubocop (0.22.0) json (>= 1.7.7, < 2) parser (~> 2.1.9) @@ -344,6 +345,9 @@ GEM sqlite3 (1.3.9) term-ansicolor (1.3.0) tins (~> 1.0) + therubyracer (0.12.1) + libv8 (~> 3.16.14.0) + ref thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) @@ -365,6 +369,7 @@ GEM uuidtools (2.1.4) warden (1.2.3) rack (>= 1.0) + websocket-driver (0.3.3) xpath (2.0.0) nokogiri (~> 1.3) yajl-ruby (1.2.0) @@ -382,7 +387,6 @@ DEPENDENCIES bootstrap-sass cancan capybara - capybara-webkit chart-js-rails cocoon coveralls @@ -408,6 +412,7 @@ DEPENDENCIES omniauth-openid paper_trail paperclip + poltergeist prawn_rails protected_attributes quiet_assets @@ -415,13 +420,13 @@ DEPENDENCIES rails-observers rdoc-generator-fivefish redcarpet - rspec (>= 3.0.0.beta) - rspec-rails (>= 3.0.0.beta) + rspec-rails rubocop sass-rails (>= 4.0.2) shoulda spring-commands-rspec sqlite3 + therubyracer transitions turbolinks uglifier (>= 1.3.0) From 59b83ceeb44f5ca1d7534d2d436b7fc2b213ecfd Mon Sep 17 00:00:00 2001 From: KalabiYau Date: Fri, 4 Jul 2014 22:37:21 +0200 Subject: [PATCH 04/15] Drop Travises usage of xvfb --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94148e6d..c3020af3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,6 @@ notifications: email: on_success: change on_failure: change -before_install: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start before_script: - cp config/database.yml.example config/database.yml - cp config/config.yml.example config/config.yml From ce3b73303928241e678ea5bbdc952003a4a57e34 Mon Sep 17 00:00:00 2001 From: KalabiYau Date: Fri, 4 Jul 2014 22:38:07 +0200 Subject: [PATCH 05/15] Drop console outputs from js --- app/assets/javascripts/osem.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/assets/javascripts/osem.js b/app/assets/javascripts/osem.js index 2fe1c40d..080fb167 100644 --- a/app/assets/javascripts/osem.js +++ b/app/assets/javascripts/osem.js @@ -180,10 +180,8 @@ function word_count(text, divId, maxcount) { $('#' + divId).text(r); if (r > maxcount) { - console.log("R is greater than maxcount"); $('#' + divId).css('color', 'red'); } else { - console.log("R is less than maxcount"); $('#' + divId).css('color', '#333'); } }; From 78cdbf81a1295665efbbcc73be92881082a4bdb0 Mon Sep 17 00:00:00 2001 From: KalabiYau Date: Fri, 4 Jul 2014 22:38:47 +0200 Subject: [PATCH 06/15] Remove AR loggin in test enviroment - speed boost hence --- config/environments/test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/environments/test.rb b/config/environments/test.rb index a4061760..64339b64 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -40,4 +40,9 @@ Osem::Application.configure do # Do not perform deliveries on test config.action_mailer.perform_deliveries = false + + config.after_initialize do + ActiveRecord::Base.logger = nil + end + end From bce32255fae8c689c7c598fc2d61395f5507afc3 Mon Sep 17 00:00:00 2001 From: KalabiYau Date: Fri, 4 Jul 2014 22:39:05 +0200 Subject: [PATCH 07/15] Cleanup current issues with schema, and regenerate latter --- db/migrate/20140623100942_create_visits.rb | 3 +-- db/migrate/20140623101032_create_ahoy_events.rb | 11 ++++------- db/schema.rb | 8 +++----- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/db/migrate/20140623100942_create_visits.rb b/db/migrate/20140623100942_create_visits.rb index ca5e325b..561fa177 100644 --- a/db/migrate/20140623100942_create_visits.rb +++ b/db/migrate/20140623100942_create_visits.rb @@ -1,7 +1,6 @@ class CreateVisits < ActiveRecord::Migration def change - create_table :visits, id: false do |t| - t.uuid :id, primary_key: true + create_table :visits do |t| t.uuid :visitor_id # the rest are recommended but optional diff --git a/db/migrate/20140623101032_create_ahoy_events.rb b/db/migrate/20140623101032_create_ahoy_events.rb index de6a5205..c865a59c 100644 --- a/db/migrate/20140623101032_create_ahoy_events.rb +++ b/db/migrate/20140623101032_create_ahoy_events.rb @@ -1,20 +1,17 @@ class CreateAhoyEvents < ActiveRecord::Migration def change - create_table :ahoy_events, id: false do |t| - t.uuid :id, primary_key: true + create_table :ahoy_events do |t| t.uuid :visit_id - # user t.integer :user_id # add t.string :user_type if polymorphic - t.string :name t.text :properties t.timestamp :time end - add_index :ahoy_events, [:visit_id] - add_index :ahoy_events, [:user_id] - add_index :ahoy_events, [:time] + add_index :ahoy_events, :visit_id + add_index :ahoy_events, :user_id + add_index :ahoy_events, :time end end diff --git a/db/schema.rb b/db/schema.rb index a58e424c..4e1a18ad 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20140626123837) do +ActiveRecord::Schema.define(version: 20140627165718) do create_table "ahoy_events", force: true do |t| t.uuid "visit_id" @@ -21,7 +21,6 @@ ActiveRecord::Schema.define(version: 20140626123837) do t.datetime "time" end -# add_index "ahoy_events", ["id"], name: "sqlite_autoindex_ahoy_events_1", unique: true add_index "ahoy_events", ["time"], name: "index_ahoy_events_on_time" add_index "ahoy_events", ["user_id"], name: "index_ahoy_events_on_user_id" add_index "ahoy_events", ["visit_id"], name: "index_ahoy_events_on_visit_id" @@ -113,13 +112,13 @@ ActiveRecord::Schema.define(version: 20140626123837) do t.string "facebook_url" t.string "google_url" t.text "lodging_description" + t.boolean "make_conference_public", default: false t.boolean "include_registrations_in_splash", default: false t.boolean "include_sponsors_in_splash", default: false t.boolean "include_tracks_in_splash", default: false t.boolean "include_tickets_in_splash", default: false t.boolean "include_social_media_in_splash", default: false t.boolean "include_program_in_splash", default: false - t.boolean "make_conference_public", default: false t.string "banner_photo_file_name" t.string "banner_photo_content_type" t.integer "banner_photo_file_size" @@ -305,8 +304,8 @@ ActiveRecord::Schema.define(version: 20140626123837) do t.text "other_special_needs" t.boolean "attended", default: false t.boolean "volunteer" - t.integer "week" t.integer "user_id" + t.integer "week" end create_table "registrations_social_events", id: false, force: true do |t| @@ -503,7 +502,6 @@ ActiveRecord::Schema.define(version: 20140626123837) do t.datetime "started_at" end -# add_index "visits", ["id"], name: "sqlite_autoindex_visits_1", unique: true add_index "visits", ["user_id"], name: "index_visits_on_user_id" create_table "votes", force: true do |t| From c482d88e3aac94152be65edca03358aee97c6ae6 Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Fri, 4 Jul 2014 22:49:37 +0200 Subject: [PATCH 08/15] Travis should not install ri and rdocs --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c3020af3..ac711855 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: ruby rvm: - 2.1.1 +before_install: + - "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" branches: only: - master From 7cd21bbf11261872d90c7314c7a43b8bcf89371b Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Fri, 4 Jul 2014 22:55:01 +0200 Subject: [PATCH 09/15] Fix view test for cfps --- Gemfile | 2 ++ Gemfile.lock | 5 +++++ spec/views/admin/callforpapers/show.html.haml_spec.rb | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index ef5a4bf3..f9f742c0 100644 --- a/Gemfile +++ b/Gemfile @@ -123,4 +123,6 @@ group :test do gem 'poltergeist' # Set of rails validations matchers to describe models gem 'shoulda' + # Extracted from RSpec 3 stub_model and mock_model + gem 'rspec-activemodel-mocks' end diff --git a/Gemfile.lock b/Gemfile.lock index 597b895c..02a4e990 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -287,6 +287,10 @@ GEM rspec-core (~> 3.0.0) rspec-expectations (~> 3.0.0) rspec-mocks (~> 3.0.0) + rspec-activemodel-mocks (1.0.1) + activemodel (>= 3.0) + activesupport (>= 3.0) + rspec-mocks (>= 2.99, < 4.0) rspec-core (3.0.2) rspec-support (~> 3.0.0) rspec-expectations (3.0.2) @@ -420,6 +424,7 @@ DEPENDENCIES rails-observers rdoc-generator-fivefish redcarpet + rspec-activemodel-mocks rspec-rails rubocop sass-rails (>= 4.0.2) diff --git a/spec/views/admin/callforpapers/show.html.haml_spec.rb b/spec/views/admin/callforpapers/show.html.haml_spec.rb index 0584f623..d04551c6 100644 --- a/spec/views/admin/callforpapers/show.html.haml_spec.rb +++ b/spec/views/admin/callforpapers/show.html.haml_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' + describe 'admin/callforpapers/show' do it 'renders callforpapers details' do @@ -8,8 +9,8 @@ describe 'admin/callforpapers/show' do end_date: Date.today + 7.days, description: 'Lorem Ipsum Dolsum') render - expect(rendered).to include("#{Date.today}") - expect(rendered).to include("#{Date.today + 7.days}") + expect(rendered).to include(Date.today.strftime('%Y-%m-%d')) + expect(rendered).to include(7.days.from_now.strftime('%Y-%m-%d')) expect(rendered).to include('Lorem Ipsum Dolsum') end From 85e86507230fe4ea14056f78aecd9550d82a9c4f Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Fri, 4 Jul 2014 22:59:27 +0200 Subject: [PATCH 10/15] Add more options to the contributur to communicate --- CONTRIBUTING.md | 3 ++- README.md | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f439038c..417df04b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,4 +28,5 @@ admins](https://github.com/orgs/openSUSE/teams/osem-admins) know! GitHub issues are the primary way for communicating about specific proposed changes to this project. If you have other questions feel free to subscribe to the [opensuse-web@opensuse.org](http://lists.opensuse.org/opensuse-web/) -mailinglist, all OSEM contributors are on that list! +mailinglist, all OSEM contributors are on that list! Additionally you can use #osem channel +on freenode IRC. diff --git a/README.md b/README.md index cf57ef37..ec9cf432 100644 --- a/README.md +++ b/README.md @@ -86,3 +86,10 @@ bundle exec guard ``` This uses [spring](https://github.com/rails/spring) to provide a [fast feedback loop for the red/green cycle](http://bitzesty.com/blog/2013/05/enable-tdd-with-faster-ruby-on-rails-stack-reloading/). + +# Communication +GitHub issues are the primary way for communicating about specific proposed +changes to this project. If you have other questions feel free to subscribe to +the [opensuse-web@opensuse.org](http://lists.opensuse.org/opensuse-web/) +mailinglist, all OSEM contributors are on that list! Additionally you can use #osem channel +on freenode IRC. From ef07990e94d7c4963309a8d864c494f7f624d439 Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Fri, 4 Jul 2014 23:02:33 +0200 Subject: [PATCH 11/15] Hound is not more here --- .hound.yml | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .hound.yml diff --git a/.hound.yml b/.hound.yml deleted file mode 100644 index fd3c9072..00000000 --- a/.hound.yml +++ /dev/null @@ -1,3 +0,0 @@ -LineLength: - Description: 'Limit lines to 100 characters.' - Max: 100 From 8596644afa57aa4c151792fc59a03dd59701979b Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Sun, 6 Jul 2014 23:00:11 +0200 Subject: [PATCH 12/15] Fix migration for person to user migration --- db/migrate/20140610165551_migrate_data_person_to_user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/migrate/20140610165551_migrate_data_person_to_user.rb b/db/migrate/20140610165551_migrate_data_person_to_user.rb index e68aa6f9..d606ba28 100644 --- a/db/migrate/20140610165551_migrate_data_person_to_user.rb +++ b/db/migrate/20140610165551_migrate_data_person_to_user.rb @@ -9,7 +9,8 @@ class MigrateDataPersonToUser < ActiveRecord::Migration def change TempPerson.all.each do |p| - user = TempUser.find(p.user_id) + user = TempUser.find_by(id: p.user_id) + next unless user if p.public_name.empty? user.name = p.email else From a3d6493ea6e6f6b157edecf55b23e7182ab7aff5 Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Sun, 6 Jul 2014 23:27:50 +0200 Subject: [PATCH 13/15] Allow to collect coverage information locally --- spec/spec_helper.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f6f3859f..dd9400f6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,6 +1,14 @@ -require 'coveralls' -Coveralls.wear!('rails') # This file is copied to spec/ when you run 'rails generate rspec:install' +require 'simplecov' + +if ENV['TRAVIS'] + require 'coveralls' + SimpleCov.formatter = Coveralls::SimpleCov::Formatter + Coveralls.wear!('rails') +else + SimpleCov.start 'rails' +end + ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) From 472b05370ea560fe33aa76b89622f3472da5b84a Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Sun, 6 Jul 2014 23:43:07 +0200 Subject: [PATCH 14/15] Add coverage improval remark [ci ckip] --- CONTRIBUTING.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 417df04b..134f0e98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,8 +11,10 @@ In particular, this community seeks the following types of contributions: * Prerequisites: familiarity with [GitHub Pull Requests](https://help.github.com/articles/using-pull-requests) and issues. * Fork the repository and make a pull-request with your changes * Make sure that the test suite passes (we have [travis](https://travis-ci.org/openSUSE/osem) enabled) before you request a pull and that you comply to our ruby styleguide (we make use of [hound-ci](https://houndci.com/)). - * Please make sure to mind what travis and hound tell you! :-) -* One of the OSEM maintainers will review your pull-request + * Please make sure to mind what travis tell you! :-) + * Please increase code coverage by you pull request (coveralls or simplecov locally will give you insight) + +* One of the OSEM maintainers will review your pull-request * If you are already a contributor (means you're in the [group osem-committers](https://github.com/orgs/openSUSE/teams/osem-committers)) and you get a positive review, you can merge your pull-request yourself * If you are not a contributor already please request a merge via the pull-request comments * Run rubocop locally for fixes according to HoundCI comments From 00e4b7e178c6960b706e2794ba9e2cb7a8a44ea4 Mon Sep 17 00:00:00 2001 From: Artem Chernikov Date: Mon, 7 Jul 2014 14:58:33 +0200 Subject: [PATCH 15/15] Fix typo in contributing.md [ci skip] --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 134f0e98..cdb7a08e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ In particular, this community seeks the following types of contributions: * Fork the repository and make a pull-request with your changes * Make sure that the test suite passes (we have [travis](https://travis-ci.org/openSUSE/osem) enabled) before you request a pull and that you comply to our ruby styleguide (we make use of [hound-ci](https://houndci.com/)). * Please make sure to mind what travis tell you! :-) - * Please increase code coverage by you pull request (coveralls or simplecov locally will give you insight) + * Please increase code coverage by your pull request (coveralls or simplecov locally will give you insight) * One of the OSEM maintainers will review your pull-request * If you are already a contributor (means you're in the [group osem-committers](https://github.com/orgs/openSUSE/teams/osem-committers)) and you get a positive review, you can merge your pull-request yourself