python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Is there a way to build multiple models and create relationship between the models and user in RSpec?
I have this method:
def current_budget(user)
total = 0
user.transactions.each do |t|
if t.income_or_expense
total += t.amount
else
total -= t.amount
end
...
cumabolat
Votes: 0
Answers: 1
Wrapping it (spec) block inside a block is not working in rails rspec
I'm trying to rescue an exception in all my test cases by wrapping it in a rescue block, but getting this error.
raise WrongScopeError,
"`#{name}` is not available on an example group (...

Narendran Kannan
Votes: 0
Answers: 1
Why is this attibute on a subject not being set in a rails rspec model spec?
I have a spec testing a model that looks like this:
RSpec.describe SomeModel, type: :model do
subject { described_class.new(test_amount: 99) }
describe 'validates a column' do
it 'does some ...

CafeHey
Votes: 0
Answers: 3
RSpec: factory not persisting after attribute changes?
Im fairly new to RSpec but I am running into an issue (This is on Rails 4 fwiw). I have a simple model/factory test:
context "Scopes" do
let (:widget) {create(:core_widget)}
it &q...
msmith1114
Votes: 0
Answers: 1