ece517-p3/expertiza

View on GitHub
spec/models/sign_up_sheet_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage

Block has too many lines. [45/25]
Open

describe SignUpSheet do
  describe '.add_signup_topic' do
    it 'will return an empty Hash when there are no topics' do
      assignment = double('Assignment')
      allow(assignment).to receive(:num_review_rounds) { nil }
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [43/25]
Open

  describe '.add_signup_topic' do
    it 'will return an empty Hash when there are no topics' do
      assignment = double('Assignment')
      allow(assignment).to receive(:num_review_rounds) { nil }
      allow(Assignment).to receive(:find) { assignment }
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Block has too many lines. [32/25]
Open

describe '.confirm_topic' do
  it "create SignedUpTeam" do
    allow(SignUpTopic).to receive(:slotAvailable?) { true }
    expect(SignUpSheet.confirmTopic(nil, nil, nil, nil)).to be(false)
  end
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

Line is too long. [260/160]
Open

      expect(SignUpSheet.add_signup_topic(2)).to eq(0 => {"id" => 0, "topic_identifier" => "topic_identifier", "topic_name" => "topic_name", "submission_1" => "2000-01-01 00:00:00", "review_1" => "2000-01-01 00:00:00", "submission_2" => "2000-01-01 00:00:00"})
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

Line is too long. [164/160]
Open

      expect(SignUpSheet.add_signup_topic(2)).to eq(0 => {"id" => 0, "topic_identifier" => "topic_identifier", "topic_name" => "topic_name", "submission_1" => nil})
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

Do not use DateTime.new without zone. Use one of Time.zone.local, DateTime.current, DateTime.new.in_time_zone, DateTime.new.utc, DateTime.new.getlocal, DateTime.new.iso8601, DateTime.new.jisx0301, DateTime.new.rfc3339, DateTime.new.to_i, DateTime.new.to_f instead.
Open

      assignment_due_date.due_at = DateTime.new(2000, 1, 1)
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

This cop checks for the use of Time methods without zone.

Built on top of Ruby on Rails style guide (https://github.com/bbatsov/rails-style-guide#time) and the article http://danilenko.org/2012/7/6/rails_timezones/ .

Two styles are supported for this cop. When EnforcedStyle is 'strict' then only use of Time.zone is allowed.

When EnforcedStyle is 'flexible' then it's also allowed to use Time.intimezone.

Example:

# always offense
Time.now
Time.parse('2015-03-02 19:05:37')

# no offense
Time.zone.now
Time.zone.parse('2015-03-02 19:05:37')

# no offense only if style is 'flexible'
Time.current
DateTime.strptime(str, "%Y-%m-%d %H:%M %Z").in_time_zone
Time.at(timestamp).in_time_zone

Prefer Date or Time over DateTime.
Open

      assignment_due_date.due_at = DateTime.new(2000, 1, 1)
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

This cop checks for uses of DateTime that should be replaced by Date or Time.

Example:

# bad - uses `DateTime` for current time
DateTime.now

# good - uses `Time` for current time
Time.now

# bad - uses `DateTime` for modern date
DateTime.iso8601('2016-06-29')

# good - uses `Date` for modern date
Date.iso8601('2016-06-29')

# good - uses `DateTime` with start argument for historical date
DateTime.iso8601('1751-04-23', Date::ENGLAND)

Use snake_case for variable names.
Open

      deadlineType = double('DeadlineType')
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

      deadlineType = double(DeadlineType)
Severity: Minor
Found in spec/models/sign_up_sheet_spec.rb by rubocop

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

There are no issues that match your filters.

Category
Status