You need to put tests inside it
blocks:
describe "exceed the maximum number of subscriptions" do
it do
user = FactoryGirl.build(:user)
GlobalVar::MAX_SUBSCRIPTIONS.times do
topic = FactoryGirl.build(:topic)
FactoryGirl.build(:subscription, topic: topic, user: user)
end
topic = FactoryGirl.build(:topic)
FactoryGirl.build(:subscription, topic: topic, user: user).should_not be_valid
end
end
This is due to how RSpec handles the context of the DSL.